Process to be executed in full-screen mode

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I am trying to develop a chat application whose interface is terminal-based. For that, I've been playing around with both screen and tmux commands.



However, I found a similarity with both of them: my commands do not run in full-screen mode, as in if I scroll up enough in the frames/panels/pane/windows, I can still visualize the history and shell.



How could I make my program to run in full-screen mode just like vi, for instance?



Thanks!







share|improve this question
















  • 2




    You may possibly be looking for something like Curses (Wikipedia link).
    – Kusalananda
    Feb 15 at 21:30










  • @kusalanada it looks promising. That might be the answer after all!
    – tehAnswer
    Feb 15 at 22:27














up vote
0
down vote

favorite












I am trying to develop a chat application whose interface is terminal-based. For that, I've been playing around with both screen and tmux commands.



However, I found a similarity with both of them: my commands do not run in full-screen mode, as in if I scroll up enough in the frames/panels/pane/windows, I can still visualize the history and shell.



How could I make my program to run in full-screen mode just like vi, for instance?



Thanks!







share|improve this question
















  • 2




    You may possibly be looking for something like Curses (Wikipedia link).
    – Kusalananda
    Feb 15 at 21:30










  • @kusalanada it looks promising. That might be the answer after all!
    – tehAnswer
    Feb 15 at 22:27












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I am trying to develop a chat application whose interface is terminal-based. For that, I've been playing around with both screen and tmux commands.



However, I found a similarity with both of them: my commands do not run in full-screen mode, as in if I scroll up enough in the frames/panels/pane/windows, I can still visualize the history and shell.



How could I make my program to run in full-screen mode just like vi, for instance?



Thanks!







share|improve this question












I am trying to develop a chat application whose interface is terminal-based. For that, I've been playing around with both screen and tmux commands.



However, I found a similarity with both of them: my commands do not run in full-screen mode, as in if I scroll up enough in the frames/panels/pane/windows, I can still visualize the history and shell.



How could I make my program to run in full-screen mode just like vi, for instance?



Thanks!









share|improve this question











share|improve this question




share|improve this question










asked Feb 15 at 20:12









tehAnswer

1032




1032







  • 2




    You may possibly be looking for something like Curses (Wikipedia link).
    – Kusalananda
    Feb 15 at 21:30










  • @kusalanada it looks promising. That might be the answer after all!
    – tehAnswer
    Feb 15 at 22:27












  • 2




    You may possibly be looking for something like Curses (Wikipedia link).
    – Kusalananda
    Feb 15 at 21:30










  • @kusalanada it looks promising. That might be the answer after all!
    – tehAnswer
    Feb 15 at 22:27







2




2




You may possibly be looking for something like Curses (Wikipedia link).
– Kusalananda
Feb 15 at 21:30




You may possibly be looking for something like Curses (Wikipedia link).
– Kusalananda
Feb 15 at 21:30












@kusalanada it looks promising. That might be the answer after all!
– tehAnswer
Feb 15 at 22:27




@kusalanada it looks promising. That might be the answer after all!
– tehAnswer
Feb 15 at 22:27










1 Answer
1






active

oldest

votes

















up vote
1
down vote



accepted










So you want to create a TUI (text-based user interface) application? As the TUI Wikipedia page says:




In Unix-like operating systems, TUIs are often constructed using the
terminal control library curses, or ncurses, a mostly compatible
library.




An easy way to interact with ncurses is with the tput command line tool. And with that we can address your specific question about a "full-screen mode". It is typically done by activating a secondary screen (which should be available in any decent terminal emulator):



tput smcup


The current screen will be hidden away (e.g. you won't be able to scroll up and see previous output) and in the new, "fresh" screen you'll render your application. When that exits revert back to the primary screen with:



tput rmcup


...and everything will be restored to as it was before.



Here is a sampling of other tput capabilities



tput cup 23 4 # move the cursor to row 23, column 4 of your terminal

tput ed # clear to end of screen

tput setaf 2 # set foreground color to bright green

tput cubl # move cursor left one space

tput rev # turn on reverse video mode

tput sc # save the cursor position
tput rc # restore the cursor position


See man tput and man 5 terminfo. For the latter you'll want to scroll down to the Predefined Capabilities section in particular.



And there are plenty of nice resources online to learn more such as http://linuxcommand.org/lc3_adv_tput.php



(Note that none of the above is related to whether or not you are using tmux or the like.)






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%2f424459%2fprocess-to-be-executed-in-full-screen-mode%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    1
    down vote



    accepted










    So you want to create a TUI (text-based user interface) application? As the TUI Wikipedia page says:




    In Unix-like operating systems, TUIs are often constructed using the
    terminal control library curses, or ncurses, a mostly compatible
    library.




    An easy way to interact with ncurses is with the tput command line tool. And with that we can address your specific question about a "full-screen mode". It is typically done by activating a secondary screen (which should be available in any decent terminal emulator):



    tput smcup


    The current screen will be hidden away (e.g. you won't be able to scroll up and see previous output) and in the new, "fresh" screen you'll render your application. When that exits revert back to the primary screen with:



    tput rmcup


    ...and everything will be restored to as it was before.



    Here is a sampling of other tput capabilities



    tput cup 23 4 # move the cursor to row 23, column 4 of your terminal

    tput ed # clear to end of screen

    tput setaf 2 # set foreground color to bright green

    tput cubl # move cursor left one space

    tput rev # turn on reverse video mode

    tput sc # save the cursor position
    tput rc # restore the cursor position


    See man tput and man 5 terminfo. For the latter you'll want to scroll down to the Predefined Capabilities section in particular.



    And there are plenty of nice resources online to learn more such as http://linuxcommand.org/lc3_adv_tput.php



    (Note that none of the above is related to whether or not you are using tmux or the like.)






    share|improve this answer


























      up vote
      1
      down vote



      accepted










      So you want to create a TUI (text-based user interface) application? As the TUI Wikipedia page says:




      In Unix-like operating systems, TUIs are often constructed using the
      terminal control library curses, or ncurses, a mostly compatible
      library.




      An easy way to interact with ncurses is with the tput command line tool. And with that we can address your specific question about a "full-screen mode". It is typically done by activating a secondary screen (which should be available in any decent terminal emulator):



      tput smcup


      The current screen will be hidden away (e.g. you won't be able to scroll up and see previous output) and in the new, "fresh" screen you'll render your application. When that exits revert back to the primary screen with:



      tput rmcup


      ...and everything will be restored to as it was before.



      Here is a sampling of other tput capabilities



      tput cup 23 4 # move the cursor to row 23, column 4 of your terminal

      tput ed # clear to end of screen

      tput setaf 2 # set foreground color to bright green

      tput cubl # move cursor left one space

      tput rev # turn on reverse video mode

      tput sc # save the cursor position
      tput rc # restore the cursor position


      See man tput and man 5 terminfo. For the latter you'll want to scroll down to the Predefined Capabilities section in particular.



      And there are plenty of nice resources online to learn more such as http://linuxcommand.org/lc3_adv_tput.php



      (Note that none of the above is related to whether or not you are using tmux or the like.)






      share|improve this answer
























        up vote
        1
        down vote



        accepted







        up vote
        1
        down vote



        accepted






        So you want to create a TUI (text-based user interface) application? As the TUI Wikipedia page says:




        In Unix-like operating systems, TUIs are often constructed using the
        terminal control library curses, or ncurses, a mostly compatible
        library.




        An easy way to interact with ncurses is with the tput command line tool. And with that we can address your specific question about a "full-screen mode". It is typically done by activating a secondary screen (which should be available in any decent terminal emulator):



        tput smcup


        The current screen will be hidden away (e.g. you won't be able to scroll up and see previous output) and in the new, "fresh" screen you'll render your application. When that exits revert back to the primary screen with:



        tput rmcup


        ...and everything will be restored to as it was before.



        Here is a sampling of other tput capabilities



        tput cup 23 4 # move the cursor to row 23, column 4 of your terminal

        tput ed # clear to end of screen

        tput setaf 2 # set foreground color to bright green

        tput cubl # move cursor left one space

        tput rev # turn on reverse video mode

        tput sc # save the cursor position
        tput rc # restore the cursor position


        See man tput and man 5 terminfo. For the latter you'll want to scroll down to the Predefined Capabilities section in particular.



        And there are plenty of nice resources online to learn more such as http://linuxcommand.org/lc3_adv_tput.php



        (Note that none of the above is related to whether or not you are using tmux or the like.)






        share|improve this answer














        So you want to create a TUI (text-based user interface) application? As the TUI Wikipedia page says:




        In Unix-like operating systems, TUIs are often constructed using the
        terminal control library curses, or ncurses, a mostly compatible
        library.




        An easy way to interact with ncurses is with the tput command line tool. And with that we can address your specific question about a "full-screen mode". It is typically done by activating a secondary screen (which should be available in any decent terminal emulator):



        tput smcup


        The current screen will be hidden away (e.g. you won't be able to scroll up and see previous output) and in the new, "fresh" screen you'll render your application. When that exits revert back to the primary screen with:



        tput rmcup


        ...and everything will be restored to as it was before.



        Here is a sampling of other tput capabilities



        tput cup 23 4 # move the cursor to row 23, column 4 of your terminal

        tput ed # clear to end of screen

        tput setaf 2 # set foreground color to bright green

        tput cubl # move cursor left one space

        tput rev # turn on reverse video mode

        tput sc # save the cursor position
        tput rc # restore the cursor position


        See man tput and man 5 terminfo. For the latter you'll want to scroll down to the Predefined Capabilities section in particular.



        And there are plenty of nice resources online to learn more such as http://linuxcommand.org/lc3_adv_tput.php



        (Note that none of the above is related to whether or not you are using tmux or the like.)







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Feb 17 at 12:28

























        answered Feb 17 at 11:58









        B Layer

        3,9001525




        3,9001525






















             

            draft saved


            draft discarded


























             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f424459%2fprocess-to-be-executed-in-full-screen-mode%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?