3

Long listings are only partially shown since the amount of lines remembered isn't too large. I'd like to cancel the limit of lines in a similar way to the following:

  1. Terminal limits scrolling
  2. How do I increase the number of lines shown on the Ubuntu terminal window?
  3. How to increase Scrollback lines in Ubuntu(14.04.2) server edition?

only I'm running an Ubuntu Server 15.10 and I'd like to do it using CLI.

I've also tried to use xrandr from the x11-xserver-utils package, but I keep getting Error: Can't open display: when running it, or when running xvidtune. I tried using a Terminal Multiplexer, but neither screen nor tmux did the trick (admit I'm not sure I took full advantage of tmux though), and setting the GRUB_CMDLINE_LINUX value did not change anything either. I've tried 1024k, 2048k etc, but nothing happend - the amount of lines remains limited.

To do the above said, I've tried to use information from the following: https://www.kernel.org/doc/Documentation/kernel-parameters.txt , https://www.kernel.org/doc/Documentation/fb/modedb.txt and https://www.kernel.org/doc/Documentation/fb/fbcon.txt, by following the links given by commentators and those who submitted their answers - I still haven't solved it, but thanks a bunch for that, guys.

NOTICE 1

One thing that did happen, is after changing the lines value with the screen Terminal Multiplexer to a large value (65000) - the screen refreshed badly. I saw white lines whenever I typed something. So I guess it did affect RAM consuming, but the amount of lines did not change.

NOTICE 2

I installed Ubuntu-Server 14.04.3 for reference - and most methods above work. I was able to send settings to the kernel through fbcon and set the "lines-history" file size to what ever I wanted, for example.

Ideas?

  • Thanks for the suggestion @muru, but that didn't solve my problem. I updated the question. – somethingorange Dec 27 '15 at 9:12
  • @muru, Eric Carvalho, Ravan, David Foerster, AzkerM - thanks for your attention, but as I stated in previous comment - and edited my question accordingly - the link did not solve my problem. I have no idea how to "unmark as duplicate", and I'd like to have others offer solutions if possible - please remove the duplicate mark. Thanks. – somethingorange Jan 12 '16 at 15:00
  • I removed the gnome-terminal & lxterminal tags, this question is about cli tools. right? – user.dz Jan 28 '16 at 18:45
  • Yes @Sneetsher, that's correct – somethingorange Jan 31 '16 at 9:19
  • Related: stackoverflow.com/questions/8760346/… – Elder Geek Feb 7 '16 at 8:56
0

If you want to change using the GUI the answers you linked to still apply.
i.e. even though the programs are being run on the server the output of those programs is still being displayed and stored on your local terminal.
Just follow the instructions given in the questions you linked to.
.
If you are using Gnome-terminal and want to change via command line.

Running this command on your local machine (where the Gnome-terminal you are using is installed) should show you your current config.

gconftool-2 -a /apps/gnome-terminal/profiles/Default

On My Ubuntu 14.04 this gives lots of key value pairs including

...
cursor_shape = block
 scrollback_lines = 10000
 use_theme_colors = false
...

Then this command should set your scroll back history to 60,000 lines

gconftool-2 --set /apps/gnome-terminal/profiles/Default/scrollback_lines --type int 60000

I did this on my system and then tested by running the command

cat /usr/share/dict/cracklib-small

This will output 52,000 lines into your terminal, if you can scroll back to the beginning of the dictionary - it worked.

If you want to set to unlimited, you could try

gconftool-2 --set /apps/gnome-terminal/profiles/Default/scrollback_unlimited --type boolean true
|improve this answer|||||
  • 1
    He wants to do the setting of terminal limit scrolling by command line as mentioned in the question. Those answers are for GUI manipulations. – Tung Tran Dec 24 '15 at 10:33
  • 1
    Good point - their statement only I'm running a server implied that they believed the CLI was their only option. – the_velour_fog Dec 24 '15 at 10:44
  • @the_velour_fog thanks for posting. I've tried to install the gconftool-2 package, but after building the dependency tree and reading the state information - it gave an error claiming the apt tool is unable to locate the package. – somethingorange Dec 24 '15 at 15:21
  • I've been running several machines so I got confused I guess - but I did manage to install the package eventually - but got no results. Running the -a command did not yield any output, and I did try the --set command too, and checked with a previous command, but no success in changing that either. – somethingorange Dec 24 '15 at 16:19
0

I suggest you work around the issue using screen or byobu-screen. My preference is for byobu-screen as it has better user interface.

screen and byobu-screen allow using -h flag, which will allow setting custom scrollback number of lines. For instance, byobu-screen -h 100 will limit my scroll back to 100 lines, and vice versa - I can set number higher than default.

screen scroll back mode is accessed through Ctrl-a+Ctrl-[ , and escaping it with hitting ESC couple times.

byobu-screen works with same keybindings, or alternatively with Alt-PgUp/Down

Install either with sudo apt-get install command, for instance, sudo apt-get install byobu or sudo apt-get install screen. Note that byobu has screen and tmux as dependency so you will get both.

|improve this answer|||||
  • Thanks for the answer @Serg. I've tried using byobu-screen but now I'm limited by the same concept. Trying to scroll up scrolls up several lines and "jumps right back" to the bottom. I still can't see previous lines printed in a long output. – somethingorange Jan 31 '16 at 9:38
0

I'm still not sure why, but I've tried to recreate it several times with a fresh install - and it works:

Who ever it was that pointed me to the third solution listed (How to increase Scrollback lines in Ubuntu(14.04.2) server edition?) thanks a bunch. In it the GRUB_CMDLINE_LINUX gets the value fbcon=scrollback:<value>[k]. The thing is - that running the update-grub or update-grub2 command afterwards did not send the parameters to the kernel at startup (for some reason), but once I started to run both consecutively - it worked.

So, I changed GRUB_CMDLINE_LINUX to something like GRUB_CMDLINE_LINUX=fbcon=scrollback:1024k, for example, and then run update-grub && update-grub2.

That seemed to do the trick.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.