Make reset on Mac like reset on Linux
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
On Mac, the reset
command in terminal almost does the same thing as clear
. On Ubuntu Linux, and maybe other flavors of Linux, the reset
command actually "resets" the terminal so that you can't scroll up or see previously input commands by scrolling. Is there a way to make the reset
command on Mac act/do the same thing as reset
does on Linux? If so, how can I do it?
command-line terminal osx ncurses
add a comment |Â
up vote
1
down vote
favorite
On Mac, the reset
command in terminal almost does the same thing as clear
. On Ubuntu Linux, and maybe other flavors of Linux, the reset
command actually "resets" the terminal so that you can't scroll up or see previously input commands by scrolling. Is there a way to make the reset
command on Mac act/do the same thing as reset
does on Linux? If so, how can I do it?
command-line terminal osx ncurses
Trytput reset
â user2497
Dec 23 '17 at 10:35
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
On Mac, the reset
command in terminal almost does the same thing as clear
. On Ubuntu Linux, and maybe other flavors of Linux, the reset
command actually "resets" the terminal so that you can't scroll up or see previously input commands by scrolling. Is there a way to make the reset
command on Mac act/do the same thing as reset
does on Linux? If so, how can I do it?
command-line terminal osx ncurses
On Mac, the reset
command in terminal almost does the same thing as clear
. On Ubuntu Linux, and maybe other flavors of Linux, the reset
command actually "resets" the terminal so that you can't scroll up or see previously input commands by scrolling. Is there a way to make the reset
command on Mac act/do the same thing as reset
does on Linux? If so, how can I do it?
command-line terminal osx ncurses
edited Dec 23 '17 at 17:49
Gilles
506k12010031529
506k12010031529
asked Dec 22 '17 at 23:33
StrangeRanger
9119
9119
Trytput reset
â user2497
Dec 23 '17 at 10:35
add a comment |Â
Trytput reset
â user2497
Dec 23 '17 at 10:35
Try
tput reset
â user2497
Dec 23 '17 at 10:35
Try
tput reset
â user2497
Dec 23 '17 at 10:35
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
5
down vote
accepted
Actually (on MacOS), it's not "the exact same thing" (the manual page description for "clear" is different from "reset").
MacOS comes with ncurses 5.7 (9 years old), with some updates to the terminal database. If you want something newer, installing MacPorts lets you update ncurses to the current (less a few months) version.
By the way, that would be newer than Ubuntu, which generally lags development versions by 6 months to 2 or more years.
Soncurses
does whatreset
on Linux does?
â StrangeRanger
Dec 22 '17 at 23:51
sure - they're both ncurses. You can see the version using "infocmp -V
"
â Thomas Dickey
Dec 23 '17 at 0:00
add a comment |Â
up vote
0
down vote
This is a bit of an historical artefact. In the dawn of Unix time_t
, computers were the big boxes in the datacenter, and terminals were separate pieces of hardware that were used to communicate with them. A terminal did not necessarily come from the same manufacturer as the computer, and each terminal manufacturer and model had their own set of extra features and quirks that had to be taken into account.
curses
, and its later successor ncurses
are libraries that hide all the make-and-model-dependent specifics of the terminals and provide standard ways to do terminal control operations like "clearing the screen" or "resetting the terminal to sane default settings". These libraries use the environment variable TERM
to decide which set of control sequences should be used.
Commands like clear
and reset
use such libraries to translate the operation requested by the user into terminal-model-specific control sequences and send them to the terminal. These model-specific control sequences are stored into termcap
or terminfo
files - termcap
is the old style, and terminfo
is what is used by ncurses
.
Today, it is very common that the "terminal" is actually a terminal emulator that runs on the same physical hardware as the actual computer. But it is still controlled as if it was a separate piece of hardware.
This leaves the programmer of the terminal emulator a certain degree of freedom to choose how specific features should be implemented. For example, the programmer might make it so that resetting the terminal will clear the scroll-back buffer - or s/he might choose otherwise, if s/he's of the opinion that the scrollback buffer "belongs" to the user and no application should have the power to clear it.
Alternatively, the programmer of the terminal emulator might have provided different control sequences for resetting the terminal either with or without clearing the scrollback buffer. In this case, the person packaging the terminal control libraries for an OS distribution will have a choice to make: should the reset
command clear the scrollback by default or not? Depending on the choice, s/he can store a different control sequence in the appropriate location in the data files used by the terminal control libraries.
It has always been possible for the system administrator to add new sets of terminal control sequences to the termcap
or terminfo
files, or to modify existing ones. Perhaps some site had a terminal model that was not widely known, or perhaps a standard definition required just a bit of tweaking to match a particular use case. If it turns out that the default control sequence used by the reset
command actually is "reset terminal without clearing scrollback", you could replace it with a "reset terminal and scrollback" code in the files.
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
5
down vote
accepted
Actually (on MacOS), it's not "the exact same thing" (the manual page description for "clear" is different from "reset").
MacOS comes with ncurses 5.7 (9 years old), with some updates to the terminal database. If you want something newer, installing MacPorts lets you update ncurses to the current (less a few months) version.
By the way, that would be newer than Ubuntu, which generally lags development versions by 6 months to 2 or more years.
Soncurses
does whatreset
on Linux does?
â StrangeRanger
Dec 22 '17 at 23:51
sure - they're both ncurses. You can see the version using "infocmp -V
"
â Thomas Dickey
Dec 23 '17 at 0:00
add a comment |Â
up vote
5
down vote
accepted
Actually (on MacOS), it's not "the exact same thing" (the manual page description for "clear" is different from "reset").
MacOS comes with ncurses 5.7 (9 years old), with some updates to the terminal database. If you want something newer, installing MacPorts lets you update ncurses to the current (less a few months) version.
By the way, that would be newer than Ubuntu, which generally lags development versions by 6 months to 2 or more years.
Soncurses
does whatreset
on Linux does?
â StrangeRanger
Dec 22 '17 at 23:51
sure - they're both ncurses. You can see the version using "infocmp -V
"
â Thomas Dickey
Dec 23 '17 at 0:00
add a comment |Â
up vote
5
down vote
accepted
up vote
5
down vote
accepted
Actually (on MacOS), it's not "the exact same thing" (the manual page description for "clear" is different from "reset").
MacOS comes with ncurses 5.7 (9 years old), with some updates to the terminal database. If you want something newer, installing MacPorts lets you update ncurses to the current (less a few months) version.
By the way, that would be newer than Ubuntu, which generally lags development versions by 6 months to 2 or more years.
Actually (on MacOS), it's not "the exact same thing" (the manual page description for "clear" is different from "reset").
MacOS comes with ncurses 5.7 (9 years old), with some updates to the terminal database. If you want something newer, installing MacPorts lets you update ncurses to the current (less a few months) version.
By the way, that would be newer than Ubuntu, which generally lags development versions by 6 months to 2 or more years.
answered Dec 22 '17 at 23:44
Thomas Dickey
49.5k584155
49.5k584155
Soncurses
does whatreset
on Linux does?
â StrangeRanger
Dec 22 '17 at 23:51
sure - they're both ncurses. You can see the version using "infocmp -V
"
â Thomas Dickey
Dec 23 '17 at 0:00
add a comment |Â
Soncurses
does whatreset
on Linux does?
â StrangeRanger
Dec 22 '17 at 23:51
sure - they're both ncurses. You can see the version using "infocmp -V
"
â Thomas Dickey
Dec 23 '17 at 0:00
So
ncurses
does what reset
on Linux does?â StrangeRanger
Dec 22 '17 at 23:51
So
ncurses
does what reset
on Linux does?â StrangeRanger
Dec 22 '17 at 23:51
sure - they're both ncurses. You can see the version using "
infocmp -V
"â Thomas Dickey
Dec 23 '17 at 0:00
sure - they're both ncurses. You can see the version using "
infocmp -V
"â Thomas Dickey
Dec 23 '17 at 0:00
add a comment |Â
up vote
0
down vote
This is a bit of an historical artefact. In the dawn of Unix time_t
, computers were the big boxes in the datacenter, and terminals were separate pieces of hardware that were used to communicate with them. A terminal did not necessarily come from the same manufacturer as the computer, and each terminal manufacturer and model had their own set of extra features and quirks that had to be taken into account.
curses
, and its later successor ncurses
are libraries that hide all the make-and-model-dependent specifics of the terminals and provide standard ways to do terminal control operations like "clearing the screen" or "resetting the terminal to sane default settings". These libraries use the environment variable TERM
to decide which set of control sequences should be used.
Commands like clear
and reset
use such libraries to translate the operation requested by the user into terminal-model-specific control sequences and send them to the terminal. These model-specific control sequences are stored into termcap
or terminfo
files - termcap
is the old style, and terminfo
is what is used by ncurses
.
Today, it is very common that the "terminal" is actually a terminal emulator that runs on the same physical hardware as the actual computer. But it is still controlled as if it was a separate piece of hardware.
This leaves the programmer of the terminal emulator a certain degree of freedom to choose how specific features should be implemented. For example, the programmer might make it so that resetting the terminal will clear the scroll-back buffer - or s/he might choose otherwise, if s/he's of the opinion that the scrollback buffer "belongs" to the user and no application should have the power to clear it.
Alternatively, the programmer of the terminal emulator might have provided different control sequences for resetting the terminal either with or without clearing the scrollback buffer. In this case, the person packaging the terminal control libraries for an OS distribution will have a choice to make: should the reset
command clear the scrollback by default or not? Depending on the choice, s/he can store a different control sequence in the appropriate location in the data files used by the terminal control libraries.
It has always been possible for the system administrator to add new sets of terminal control sequences to the termcap
or terminfo
files, or to modify existing ones. Perhaps some site had a terminal model that was not widely known, or perhaps a standard definition required just a bit of tweaking to match a particular use case. If it turns out that the default control sequence used by the reset
command actually is "reset terminal without clearing scrollback", you could replace it with a "reset terminal and scrollback" code in the files.
add a comment |Â
up vote
0
down vote
This is a bit of an historical artefact. In the dawn of Unix time_t
, computers were the big boxes in the datacenter, and terminals were separate pieces of hardware that were used to communicate with them. A terminal did not necessarily come from the same manufacturer as the computer, and each terminal manufacturer and model had their own set of extra features and quirks that had to be taken into account.
curses
, and its later successor ncurses
are libraries that hide all the make-and-model-dependent specifics of the terminals and provide standard ways to do terminal control operations like "clearing the screen" or "resetting the terminal to sane default settings". These libraries use the environment variable TERM
to decide which set of control sequences should be used.
Commands like clear
and reset
use such libraries to translate the operation requested by the user into terminal-model-specific control sequences and send them to the terminal. These model-specific control sequences are stored into termcap
or terminfo
files - termcap
is the old style, and terminfo
is what is used by ncurses
.
Today, it is very common that the "terminal" is actually a terminal emulator that runs on the same physical hardware as the actual computer. But it is still controlled as if it was a separate piece of hardware.
This leaves the programmer of the terminal emulator a certain degree of freedom to choose how specific features should be implemented. For example, the programmer might make it so that resetting the terminal will clear the scroll-back buffer - or s/he might choose otherwise, if s/he's of the opinion that the scrollback buffer "belongs" to the user and no application should have the power to clear it.
Alternatively, the programmer of the terminal emulator might have provided different control sequences for resetting the terminal either with or without clearing the scrollback buffer. In this case, the person packaging the terminal control libraries for an OS distribution will have a choice to make: should the reset
command clear the scrollback by default or not? Depending on the choice, s/he can store a different control sequence in the appropriate location in the data files used by the terminal control libraries.
It has always been possible for the system administrator to add new sets of terminal control sequences to the termcap
or terminfo
files, or to modify existing ones. Perhaps some site had a terminal model that was not widely known, or perhaps a standard definition required just a bit of tweaking to match a particular use case. If it turns out that the default control sequence used by the reset
command actually is "reset terminal without clearing scrollback", you could replace it with a "reset terminal and scrollback" code in the files.
add a comment |Â
up vote
0
down vote
up vote
0
down vote
This is a bit of an historical artefact. In the dawn of Unix time_t
, computers were the big boxes in the datacenter, and terminals were separate pieces of hardware that were used to communicate with them. A terminal did not necessarily come from the same manufacturer as the computer, and each terminal manufacturer and model had their own set of extra features and quirks that had to be taken into account.
curses
, and its later successor ncurses
are libraries that hide all the make-and-model-dependent specifics of the terminals and provide standard ways to do terminal control operations like "clearing the screen" or "resetting the terminal to sane default settings". These libraries use the environment variable TERM
to decide which set of control sequences should be used.
Commands like clear
and reset
use such libraries to translate the operation requested by the user into terminal-model-specific control sequences and send them to the terminal. These model-specific control sequences are stored into termcap
or terminfo
files - termcap
is the old style, and terminfo
is what is used by ncurses
.
Today, it is very common that the "terminal" is actually a terminal emulator that runs on the same physical hardware as the actual computer. But it is still controlled as if it was a separate piece of hardware.
This leaves the programmer of the terminal emulator a certain degree of freedom to choose how specific features should be implemented. For example, the programmer might make it so that resetting the terminal will clear the scroll-back buffer - or s/he might choose otherwise, if s/he's of the opinion that the scrollback buffer "belongs" to the user and no application should have the power to clear it.
Alternatively, the programmer of the terminal emulator might have provided different control sequences for resetting the terminal either with or without clearing the scrollback buffer. In this case, the person packaging the terminal control libraries for an OS distribution will have a choice to make: should the reset
command clear the scrollback by default or not? Depending on the choice, s/he can store a different control sequence in the appropriate location in the data files used by the terminal control libraries.
It has always been possible for the system administrator to add new sets of terminal control sequences to the termcap
or terminfo
files, or to modify existing ones. Perhaps some site had a terminal model that was not widely known, or perhaps a standard definition required just a bit of tweaking to match a particular use case. If it turns out that the default control sequence used by the reset
command actually is "reset terminal without clearing scrollback", you could replace it with a "reset terminal and scrollback" code in the files.
This is a bit of an historical artefact. In the dawn of Unix time_t
, computers were the big boxes in the datacenter, and terminals were separate pieces of hardware that were used to communicate with them. A terminal did not necessarily come from the same manufacturer as the computer, and each terminal manufacturer and model had their own set of extra features and quirks that had to be taken into account.
curses
, and its later successor ncurses
are libraries that hide all the make-and-model-dependent specifics of the terminals and provide standard ways to do terminal control operations like "clearing the screen" or "resetting the terminal to sane default settings". These libraries use the environment variable TERM
to decide which set of control sequences should be used.
Commands like clear
and reset
use such libraries to translate the operation requested by the user into terminal-model-specific control sequences and send them to the terminal. These model-specific control sequences are stored into termcap
or terminfo
files - termcap
is the old style, and terminfo
is what is used by ncurses
.
Today, it is very common that the "terminal" is actually a terminal emulator that runs on the same physical hardware as the actual computer. But it is still controlled as if it was a separate piece of hardware.
This leaves the programmer of the terminal emulator a certain degree of freedom to choose how specific features should be implemented. For example, the programmer might make it so that resetting the terminal will clear the scroll-back buffer - or s/he might choose otherwise, if s/he's of the opinion that the scrollback buffer "belongs" to the user and no application should have the power to clear it.
Alternatively, the programmer of the terminal emulator might have provided different control sequences for resetting the terminal either with or without clearing the scrollback buffer. In this case, the person packaging the terminal control libraries for an OS distribution will have a choice to make: should the reset
command clear the scrollback by default or not? Depending on the choice, s/he can store a different control sequence in the appropriate location in the data files used by the terminal control libraries.
It has always been possible for the system administrator to add new sets of terminal control sequences to the termcap
or terminfo
files, or to modify existing ones. Perhaps some site had a terminal model that was not widely known, or perhaps a standard definition required just a bit of tweaking to match a particular use case. If it turns out that the default control sequence used by the reset
command actually is "reset terminal without clearing scrollback", you could replace it with a "reset terminal and scrollback" code in the files.
answered Dec 23 '17 at 17:49
telcoM
10.8k11232
10.8k11232
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f412613%2fmake-reset-on-mac-like-reset-on-linux%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Try
tput reset
â user2497
Dec 23 '17 at 10:35