Make reset on Mac like reset on Linux

The name of the pictureThe name of the pictureThe name of the pictureClash 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?







share|improve this question






















  • Try tput reset
    – user2497
    Dec 23 '17 at 10:35














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?







share|improve this question






















  • Try tput reset
    – user2497
    Dec 23 '17 at 10:35












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?







share|improve this question














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?









share|improve this question













share|improve this question




share|improve this question








edited Dec 23 '17 at 17:49









Gilles

506k12010031529




506k12010031529










asked Dec 22 '17 at 23:33









StrangeRanger

9119




9119











  • Try tput 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




Try tput reset
– user2497
Dec 23 '17 at 10:35










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.






share|improve this answer




















  • 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

















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.






share|improve this answer




















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );








     

    draft saved


    draft discarded


















    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






























    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.






    share|improve this answer




















    • 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














    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.






    share|improve this answer




















    • 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












    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.






    share|improve this answer












    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.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Dec 22 '17 at 23:44









    Thomas Dickey

    49.5k584155




    49.5k584155











    • 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
















    • 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















    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












    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.






    share|improve this answer
























      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.






      share|improve this answer






















        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.






        share|improve this answer












        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.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Dec 23 '17 at 17:49









        telcoM

        10.8k11232




        10.8k11232






















             

            draft saved


            draft discarded


























             


            draft saved


            draft discarded














            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













































































            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Displaying single band from multi-band raster using QGIS

            How many registers does an x86_64 CPU actually have?