Tip: scrolling up & down in LXterminal

Forum Forums General Tips and Tricks Tip: scrolling up & down in LXterminal

  • This topic has 8 replies, 4 voices, and was last updated Mar 19-6:04 pm by mikey777.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #79288
    Member
    mikey777

      I have an antiX21+LXDE set-up. Scrolling the output of LXterminal can be a real pain, particularly if there’s a lot of output, because one appears to be limited to using the scroll bar. The PgUp and PgDn keys don’t appear to help here, either alone or in combination with the Ctrl key.

      This means that if you have a lot of terminal output, small movements of the scroll bar can lead to several pages being jumped through, making scrolling in small incremental steps very difficult.

      I found a solution: before you use the Ctrl+PgUp or Ctrl+PgDn key combinations, to scroll up or down respectively, first press the Num Lk key. When you want to exit, and return to normal LXterminal operation, just press Num Lk again.

      • This topic was modified 1 year, 1 month ago by mikey777.

      ▪ 32-bit antix19.4-core+LXDE installed on :
      - (2011) Samsung NP-N145 Plus (JP04UK) – single-core CPU Intel Atom N455@1.66GHz, 2GB RAM, integrated graphics.
      ▪ 64-bit antix21-base+LXDE installed on:
      - (2008) Asus X71Q (7SC002) – dual CPU Intel T3200@2.0GHz, 4GB RAM. Graphics: Intel Mobile 4 Series, integrated graphics
      - (2007) Packard Bell Easynote MX37 (ALP-Ajax C3) – dual CPU Intel T2310@1.46GHz, 2GB RAM. Graphics: Silicon Integrated Systems.

      #79290
      Member
      sybok
        Helpful
        Up
        0
        ::

        Use case:
        You expect a lot of information written in terminal before you run a command.
        And you would like to browse it later or as it appears.

        Few comments:
        1) Beware of max. count of displayed lines in the terminal:
        If the value of display-lines is too small, you may “lose” the beginning of the information.
        You can increase the number of lines to be displayed in the terminal or you can redirect the stream(s) to file(s).
        2) Redirection:
        2.A) Use utility ‘tee’ that prints the output in the terminal and at the same time it redirects it to a file.
        my-command | tee filename
        See manual pages of tee (‘man tee’) for more details and options.
        The file can be accessed later on with a text editor of preference.
        2.B) Custom redirection such as ‘my-command 1>stdout.txt 2>stderr.txt’ or redirect both streams into one and this joint stream into a file.
        The disadvantage of 2.B) is that it does not print (the redirected stream(s)) to the screen/terminal.

        #79292
        Member
        mikey777
          Helpful
          Up
          0
          ::

          Use case:
          You expect a lot of information written in terminal before you run a command.
          And you would like to browse it later or as it appears.

          Few comments:
          1) Beware of max. count of displayed lines in the terminal:
          If the value of display-lines is too small, you may “lose” the beginning of the information.
          You can increase the number of lines to be displayed in the terminal or you can redirect the stream(s) to file(s).
          2) Redirection:
          2.A) Use utility ‘tee’ that prints the output in the terminal and at the same time it redirects it to a file.
          my-command | tee filename
          See manual pages of tee (‘man tee’) for more details and options.
          The file can be accessed later on with a text editor of preference.
          2.B) Custom redirection such as ‘my-command 1>stdout.txt 2>stderr.txt’ or redirect both streams into one and this joint stream into a file.
          The disadvantage of 2.B) is that it does not print (the redirected stream(s)) to the screen/terminal.

          I do apologise, but I don’t see the relevance of this to the tip I put forward for scrolling up and down, using the arrow keys, in LXterminal. It’s always best to keep it simple.

          If you need to change the number of lines displayed by LXterminal, open LXterminal and simply go to EDIT, PREFERENCES, then DISPLAY, and then change the number of lines under the heading Scroll-back lines to the value you want. The default value is 1000. I needed to change mine to 10000, as the output from the command get_iplayer “.*” lists a few thousand TV programmes. Hope this helps.

          • This reply was modified 1 year, 1 month ago by mikey777.

          ▪ 32-bit antix19.4-core+LXDE installed on :
          - (2011) Samsung NP-N145 Plus (JP04UK) – single-core CPU Intel Atom N455@1.66GHz, 2GB RAM, integrated graphics.
          ▪ 64-bit antix21-base+LXDE installed on:
          - (2008) Asus X71Q (7SC002) – dual CPU Intel T3200@2.0GHz, 4GB RAM. Graphics: Intel Mobile 4 Series, integrated graphics
          - (2007) Packard Bell Easynote MX37 (ALP-Ajax C3) – dual CPU Intel T2310@1.46GHz, 2GB RAM. Graphics: Silicon Integrated Systems.

          #79311
          Member
          sybok
            Helpful
            Up
            0
            ::

            No need to apologize; I am aware my reply was a borderline off-topic remark and the two relations were:
            1) Be aware of the max. scroll-back lines setting (previously not mentioned)
            This could result in an unwanted surprise when one scrolls to the top with part of the output missing.
            2) You may redirect to a file which provides a more permanent output for later processing.
            I thought (not so sure anymore) that some may find this a useful alternative.

            #79318
            Member
            mikey777
              Helpful
              Up
              0
              ::

              Be aware of the max. scroll-back lines setting (previously not mentioned)
              This could result in an unwanted surprise when one scrolls to the top with part of the output missing.

              Thanks sybok. Do you know what the limit for the number of scroll-back lines is, in LXterminal?
              For all intents and purposes this has never concerned me, as I’ve never needed more than 10,000 lines when I use get_iplayer in terminal, and scroll-back is certainly fine with this number – been using it for a few years now without issue. However, it’s good you pointed this out, as in some cases it might be an issue …

              ▪ 32-bit antix19.4-core+LXDE installed on :
              - (2011) Samsung NP-N145 Plus (JP04UK) – single-core CPU Intel Atom N455@1.66GHz, 2GB RAM, integrated graphics.
              ▪ 64-bit antix21-base+LXDE installed on:
              - (2008) Asus X71Q (7SC002) – dual CPU Intel T3200@2.0GHz, 4GB RAM. Graphics: Intel Mobile 4 Series, integrated graphics
              - (2007) Packard Bell Easynote MX37 (ALP-Ajax C3) – dual CPU Intel T2310@1.46GHz, 2GB RAM. Graphics: Silicon Integrated Systems.

              #79320
              Member
              sybok
                Helpful
                Up
                0
                ::

                Hi, I did mean the limit *corresponding to current setting* (you have already increased from 10^3 to 10^4 lines as mentioned in your second post), not max. possible scroll-back line count that can be set in LXterminal.
                When performing a system upgrade of Ubuntu, the 10^3 (or 10^4; not sure anymore because I recall to have sometimes modified in some of the terminals in some of my installations) lines proved insufficient and scrolling back to the top was missing some information I found important (packages to be removed during the upgrade which I have learnt to copy-paste to a file after that).

                #79327
                Member
                blur13
                  Helpful
                  Up
                  0
                  ::

                  I for one appreciated syboks tip, thanks! Having the output in a textfile also makes it searchable. Also, increasing the scroll-back buffer increases RAM usage by quite a lot (in relative terms). Peace out.

                  #79329
                  Member
                  stevesr0
                    Helpful
                    Up
                    0
                    ::

                    Thanks, all for the tips provided in this thread.

                    Recently, I needed to compare differences between modules loaded with one kernel and another on the same computer. Being able to save a copy using while booting from the one kernel and comparing to the same file while booted under the other was made possible by creation of files, rather than just looking at the “live” output. (I could also have just piped the output to the file, but with tee, you can see it is the correct output you want to use.)

                    stevesr0

                    #79388
                    Member
                    mikey777
                      Helpful
                      Up
                      0
                      ::

                      2.A) Use utility ‘tee’ that prints the output in the terminal and at the same time it redirects it to a file.
                      my-command | tee filename

                      Many thanks sybok, and also to stevesr0 & blur13 for drawing my attention to what you said about the tee command – I’ve just tried it and found it to be really useful! Thanks again (sorry if I appeared initially a bit dismissive).

                      ▪ 32-bit antix19.4-core+LXDE installed on :
                      - (2011) Samsung NP-N145 Plus (JP04UK) – single-core CPU Intel Atom N455@1.66GHz, 2GB RAM, integrated graphics.
                      ▪ 64-bit antix21-base+LXDE installed on:
                      - (2008) Asus X71Q (7SC002) – dual CPU Intel T3200@2.0GHz, 4GB RAM. Graphics: Intel Mobile 4 Series, integrated graphics
                      - (2007) Packard Bell Easynote MX37 (ALP-Ajax C3) – dual CPU Intel T2310@1.46GHz, 2GB RAM. Graphics: Silicon Integrated Systems.

                    Viewing 9 posts - 1 through 9 (of 9 total)
                    • You must be logged in to reply to this topic.