Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
terminal settings (SOLUTION: JUST PLAIN CRAP)
View unanswered posts
View posts from last 24 hours

Goto page 1, 2, 3  Next  
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
deLockloire
n00b
n00b


Joined: 10 Dec 2003
Posts: 62

PostPosted: Sat Jan 03, 2004 7:39 pm    Post subject: terminal settings (SOLUTION: JUST PLAIN CRAP) Reply with quote

i've got some settings that'll drive me crazy on the long run, which, if for nothing else, for the sake of keeping my sanity, I wouldn't like. :)

1) my console's output history is too short (NOT the bash command history). I'd like to set a larger buffer for that. Say, at least about 30 pages long.

2) also, the terminal buffer empties after switching to another terminal (and switching back again). this means I can no longer check the output history by using SHIFT+PAGE UP/DOWN, which can be very annoying.

Note that this is not a question for any desktop environment, this is about the default console mode of gentoo. How can I change these settings, or where can I read more about changing the virtual terminal settings?

thanks


Last edited by deLockloire on Tue Jan 06, 2004 3:46 am; edited 2 times in total
Back to top
View user's profile Send private message
JPMRaptor
Guru
Guru


Joined: 04 Oct 2002
Posts: 410
Location: Maryland

PostPosted: Sun Jan 04, 2004 1:38 am    Post subject: Reply with quote

Don't know how to adjust the console, but have you tried the "tee" command. It redirects the output to a file and still sends the output to the console.
Code:
Ex: emerge world | tee emerge.log


Another option is to just direct the output to a file and use less, more... to monitor the output. Running "tail -f output.log" will give you the output as it happens.
Back to top
View user's profile Send private message
Tazmanian
Apprentice
Apprentice


Joined: 01 Jul 2003
Posts: 222

PostPosted: Sun Jan 04, 2004 7:11 am    Post subject: Reply with quote

You can also use "screen", which not only has its own scrollback buffer, but is also a really handy tool. :)
Back to top
View user's profile Send private message
deLockloire
n00b
n00b


Joined: 10 Dec 2003
Posts: 62

PostPosted: Sun Jan 04, 2004 1:59 pm    Post subject: Reply with quote

thanks for the tips. what is "screen," btw?

of course, if anyone knows the answer for my original question(s), don't hestiate to make it public :)
Back to top
View user's profile Send private message
deLockloire
n00b
n00b


Joined: 10 Dec 2003
Posts: 62

PostPosted: Sun Jan 04, 2004 2:53 pm    Post subject: Reply with quote

Just to make me feel easy, is there anyone who experienced the same problems I'm talking about? (esp. the erasure of a terminal buffer after swithing to another terminal)
Back to top
View user's profile Send private message
mattman
n00b
n00b


Joined: 29 Jan 2003
Posts: 22
Location: St. Louis, MO, USA

PostPosted: Sun Jan 04, 2004 5:43 pm    Post subject: Reply with quote

deLockloire wrote:
Just to make me feel easy, is there anyone who experienced the same problems I'm talking about? (esp. the erasure of a terminal buffer after swithing to another terminal)


That's normal, as is the relatively small scrollback buffer.

deLockloire wrote:
what is "screen," btw?


screen is a sort of virtual console program. You run it, and it creates a new "window" with a shell in it. You can then create subsequent windows running other programs, and switch between the windows. It's very similar to the virtual terminals you get by default on linux (where ALT+Fn switches you to a new terminal), but screen allows you to disconnect your session and log out while your programs continue to run, then reattach somewhere else. For example you could run a big emerge/ebuild inside screen, detach it, log out, go to another machine, log in remotely, and reattach to check on the progress of your build.

Relative to what you asked, I think it can keep its own scrollback buffer.

I guess it's sort of complicated to explain; best to emerge screen and run it for yourself, then hit ^A and then ? for help.
Back to top
View user's profile Send private message
deLockloire
n00b
n00b


Joined: 10 Dec 2003
Posts: 62

PostPosted: Sun Jan 04, 2004 10:34 pm    Post subject: Reply with quote

okey dokey. logging the output is a possible solution. emerging screen is another. however, i'd not make use of them except as a last resort. the problem with these solutions is that they are workarounds for the porblem at hand. there MUST be a direct solution (i.e., configuring the console settings), i just don't know where to look. i really appreciate all the help u're giving me folks, but if there's anyone who has at least the vaguest idea where i could start, please relieve me of my torment and tell me... :)
Back to top
View user's profile Send private message
mhodak
Veteran
Veteran


Joined: 15 Nov 2003
Posts: 1218

PostPosted: Sun Jan 04, 2004 11:37 pm    Post subject: Reply with quote

I remember a post about this couple of moths ago - somebody was trying to increase console history buffer size. He found that this is set somewhere in kernel sources as an amount of memory allocated for history. You can try to search for this post, I was trying to find it myself, but I could not find it.
If you have no luck searching for this post, it porbably should not be very hard to identify appropriate place in kernel sources.

As for keeping buffer when console-switching, this will be more difficult to do. I suspect soem kerenl hacking is required to do that.

Do not forget to post your findings if you find how to change these things in kernel.
Back to top
View user's profile Send private message
deLockloire
n00b
n00b


Joined: 10 Dec 2003
Posts: 62

PostPosted: Sun Jan 04, 2004 11:58 pm    Post subject: Reply with quote

ok. thanks. i'll look into it. and supposing i find anything, u can bet i'm going to post about it. :)
Back to top
View user's profile Send private message
deLockloire
n00b
n00b


Joined: 10 Dec 2003
Posts: 62

PostPosted: Mon Jan 05, 2004 12:04 am    Post subject: Reply with quote

if u're interested, i got the link u talked about.
Back to top
View user's profile Send private message
deLockloire
n00b
n00b


Joined: 10 Dec 2003
Posts: 62

PostPosted: Mon Jan 05, 2004 12:24 am    Post subject: Reply with quote

Ok. the poster of the previous link (eunuque) seems to have found a solution for one of my problems.

eunuque wrote:
Scrollback buffer size *IS* configurable using a kernel command line option. It is not mentioned in the /usr/src/linux/Documentation/fb directory, but you can see in /usr/src/linux/drivers/video/fbmem.c that you can pass "scrollback" as parameter to the "video=" option.


i.e., u can add this:
Code:
video=scrollback:$SIZE


to ur appropriate grub.conf entry (where u can give, i assume, any value in K(ilobytes) or in M(egabytes). i'm at the middle of an openoffice compilation, so i cannot verify it will work, but it's a start! i will verify this as soon as the compilation will finish, which i assume will not happen for a long time. however, if u try it and have results, post it. by default, u can scroll back (SHIFT+PGUP) about 14 times (i.e., 7 screens long).

i'm going to look into the other, much graver problem i might add, i.e., the buffer purge when u switch away from a terminal. i happen to know that under FreeBSD, the terminal does NOT work like it does under gentoo, so, because of the similarities between the two OSes, i reckon it is also configurable. the key to this might be found somewhere within the kernel documentation. on the other hand, if this is gentoo specific, it should be changed with the next release. i'm going to have 2 exams in the next 2 days, so the solution won't come any soon...

take care
Back to top
View user's profile Send private message
mhodak
Veteran
Veteran


Joined: 15 Nov 2003
Posts: 1218

PostPosted: Mon Jan 05, 2004 9:26 am    Post subject: Reply with quote

Great to see that you found the post. I could not find it myself.

Unfortunatelly, it is inconvenient for me to reboot now too, although I would like to have more scrollback too.

As for as buffer purge when switching terminal, it is not gentoo specific, I saw the same on three other linux distributions I was using.
Back to top
View user's profile Send private message
vdboor
Guru
Guru


Joined: 03 Dec 2003
Posts: 592
Location: The Netherlands

PostPosted: Mon Jan 05, 2004 10:31 am    Post subject: Reply with quote

Tazmanian wrote:
You can also use "screen", which not only has its own scrollback buffer, but is also a really handy tool. :)


It's quite strange, but I can't use it when the screen is attached in the 'konsole' terminal. Does anyone have a clue about this?
_________________
The best way to accelerate a windows server is by 9.81M/S²
Linux user #311670 and Yet Another Perl Programmer

[ screenies | Coding on KMess ]
Back to top
View user's profile Send private message
deLockloire
n00b
n00b


Joined: 10 Dec 2003
Posts: 62

PostPosted: Mon Jan 05, 2004 6:23 pm    Post subject: Reply with quote

i don't know how eunuque succeded in getting it to work, but i couldn't. did anyone succeeded on a 2.6.0 kernel?
Back to top
View user's profile Send private message
deLockloire
n00b
n00b


Joined: 10 Dec 2003
Posts: 62

PostPosted: Mon Jan 05, 2004 11:17 pm    Post subject: Reply with quote

it seems that the video= argument can only be employed when the

Code:
Device Drivers --->
     Graphics Support --->
          [ * ] Support for frame buffer devices


is compiled into the kernel. so i recompiled my kernel, and finally i could use boot arguments like
Code:
vga=0x315
which gave me a nice 800x600 console display, but the
Code:
video=scrollback:$SIZE
still didn't work. :(
Back to top
View user's profile Send private message
deLockloire
n00b
n00b


Joined: 10 Dec 2003
Posts: 62

PostPosted: Tue Jan 06, 2004 3:45 am    Post subject: Reply with quote

after a long torment (nightmares about terminal settings and stuff) here we go:

there is NO way one can directly change the scrollback buffer settings. can you actually believe this?! 8O astonishing, isn't it? this is due to the crappy implementation of the console drivers. you can read about how the terminal scrollback buffering works here. what you can do, however, is to simply reduce the number of PTYs you enable in the kernel. this would reduce the amount of terminals among which the video memory will be divided. my suggestion is to reset the default kernel values:
Code:
Device Drivers --->
   Character devices --->
      [*] Unix98 PTY support
      (24) Maximum number of Unix98 PTYs in use (0-2048) # down from 256
   Graphics support --->
      [*] Support for framebuffer devices
      [*] VESA VGA graphics support # or the appropriate driver for your card
      Console display driver support --->
         <*> Framebuffer Console support

24 terminals should be more than enough for an average user. if you're box is not very terminal intensive (lots of ssh connections, open VTs etc.), you can safely reduce the amount to 24, but you can pick a greater number, but there is a good chance that you won't ever make use of the default 256 possible terminals on your box. with these settings, i was able to pray my buffer up to 848 lines (up from the default 180).

here's a little script (thanks to david_ross from www.linuxquestions.org) with which you can easily count the number of lines your scrollback buffer can hold at the moment:
Code:
#!/bin/bash

num=500
while [ $num -gt 1 ];do
# Just line numbers
echo $num
# Use more memory
#echo $num abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
num=$(($num-1))
done
echo -n "1 - "

if you've followed the links, you can know by now, that there is absolutely nothing you can do about the erasure of a terminal buffer when you switch to another VT. this, IMHO, is unacceptable. i can't fathom how very few of you seem to be concerned with this when i'm going completely craaaaazzyyy :) (not that you can do anything about it, but lots of lots of complaining, perhaps, might result in a patched gentoo kernel or something. just to show a comparision, on FreeBSD, you can easily costumize these aspects of your terminal (and, of course, many more).

take care


Last edited by deLockloire on Tue Jan 06, 2004 2:20 pm; edited 2 times in total
Back to top
View user's profile Send private message
floam
Veteran
Veteran


Joined: 27 Oct 2002
Posts: 1067
Location: Vancouver, WA USA

PostPosted: Tue Jan 06, 2004 4:04 am    Post subject: Reply with quote

Well, it makes sense the memory gets overwritten when you switch consoles. Why not just use screen? It's really nice. You can emerge something in one of your consoles, then ctrl-d to detach, (emerge is still running in the background,) then log into XFree and open up a terminal and screen -r to have it right there. It's really nifty, *made* for this task, and has a configurable buffer.
_________________
Think about your breathing.
http://floam.sh.nu
Back to top
View user's profile Send private message
deLockloire
n00b
n00b


Joined: 10 Dec 2003
Posts: 62

PostPosted: Tue Jan 06, 2004 4:36 am    Post subject: Reply with quote

floam wrote:
Well, it makes sense the memory gets overwritten when you switch consoles.

yes, it does, if this part of the codebase isn't written decently, like in onther unix-like OSes. but i suppose, unless i want to switch to freebsd, i just have to get used to this.

Quote:
Why not just use screen?


it's already been suggested. it seems, in the end, i'll have to do that. it just bugs me to resort to that, because it's a mere workaround for a problem i thought there was a solution for. not that there isn't, i just don't like it. but, hey, not your fault, is it? :) thanks for the tip.
Back to top
View user's profile Send private message
deLockloire
n00b
n00b


Joined: 10 Dec 2003
Posts: 62

PostPosted: Tue Jan 06, 2004 2:18 pm    Post subject: Reply with quote

it turns out that it's not enough in itself to lower the number of terminals. you also have to enable framebuffer support for console. see my edited post about this.
Back to top
View user's profile Send private message
Decibels
Veteran
Veteran


Joined: 16 Aug 2002
Posts: 1629
Location: U.S.A.

PostPosted: Tue Jan 06, 2004 3:31 pm    Post subject: Reply with quote

Bash history size: man bash

Code:
HISTSIZE
The number of commands to remember in the command history (see
HISTORY below).  The default value is 500.

OR
Code:
HISTFILESIZE
The  maximum  number  of  lines contained in the history file.
When this variable is assigned a value, the  history  file  is
truncated,  if  necessary, to contain no more than that number
of lines.  The default value is 500.  The history file is also
truncated  to  this  size after writing it when an interactive
shell exits.


Put it in your ~/.bash_profile or /etc/profile.
_________________
Support bacteria – they’re the only culture some people have.”

– Steven Wright
Back to top
View user's profile Send private message
deLockloire
n00b
n00b


Joined: 10 Dec 2003
Posts: 62

PostPosted: Tue Jan 06, 2004 4:06 pm    Post subject: Reply with quote

Decibels wrote:
Bash history size: man bash


i really appreciate your help, however, it seems that, despite my capitalization of "NOT", a vital part of my original question has eluded you. below is the the text (in bold) that has accidentally avoided your attention:

deLockloire wrote:
1) my console's output history is too short (NOT the bash command history). I'd like to set a larger buffer for that. Say, at least about 30 pages long.


bash was the first thing i checked. obviously, as i suspected, it has nothing to do with my VTs' buffer settings. but thanks for your effort. ;)

take care
Back to top
View user's profile Send private message
Decibels
Veteran
Veteran


Joined: 16 Aug 2002
Posts: 1629
Location: U.S.A.

PostPosted: Wed Jan 07, 2004 4:11 pm    Post subject: Reply with quote

Quote:
1) my console's output history is too short (NOT the bash command history). I'd like to set a larger buffer for that. Say, at least about 30 pages long.

I guess you mean 'scroll-back buffer' then, why didn't you say so?? Oops, guess someone else did. My mistake.

I found out how to do it in aterm. Max is 32767 lines though. Pretty cool, also added transparency,....
Same way works with xterm.

Seems you can do it in eterm also, not sure on the max size though.

Looks like konsole from kde is the best I have seen so far. You can set it unlimited. Just did a cat on /var/log/syslog and could scroll back thru the whole thing, even in multiple terminals.

Other terminals? Didn't feel like googling anymore.

Works great. Seems that how to do it again has just eluded me. :twisted:

Don't need to edit the kernel or use screen either.
_________________
Support bacteria – they’re the only culture some people have.”

– Steven Wright
Back to top
View user's profile Send private message
deLockloire
n00b
n00b


Joined: 10 Dec 2003
Posts: 62

PostPosted: Wed Jan 07, 2004 4:44 pm    Post subject: Reply with quote

Decibels wrote:
I guess you mean 'scroll-back buffer' then, why didn't you say so??


i have a good reason for that. at the time i started this thread i didn't know what exactly it was called. that is why i wrote console output history, which, i thing, is perfectly clear. this term was used in other posts as well, but to avoid any misunderstanding, i've put "NOT the bash command history" which sould've eleminated any doubt about what i was referring to. later on, however, the term "scrollback buffer" came into use, as u can see in my later posts (but u already know this :)).

Decibels wrote:
I also found out how to do it in aterm. Max is 32767 lines though. Pretty cool, also added transparency,.... Same way works with xterm.

this is nice. :) the problem is that i want to change the default CLI terminal settings. i assume eterm is for GUI environment. so is konsole. i prefer to use CLI over GUI and use GUI only for specific purposes. look at my original request on this issue ;):

deLockloire wrote:
Note that this is not a question for any desktop environment, this is about the default console mode of gentoo.

but u just gave me and idea. since i'm new to linux, i'm not sure whether it can be done, but you might. is it possible to write a script that starts automatically on my bootup and redirects all the output of my default terminals (ALT+F1-F6) to (a) log file(s), from where the terminal(s) read(s) the info when i'm scrolling back? also this/these log file(s) should be purged automatically when i exit a terminal. note that there is a good chance i will use screen eventually, but i'm curious anyway.

alternately, do u know any kernels that are patched with a good implementation of console drivers (the result of which would be a different handling of the VTs and therefore of the scrollback buffer, and possibly, the ability even to set some of the parameters of ur CLI console behavior--like the number of lines to scroll back :)) u can set such things in the BSD kernel. as u could see from this thread, the bigger problem is the erasure of the scrollback buffer when u switch to another terminal. i tried to switch to TERM25, which is the default terminal under BSD, but it didn't bring me the expected results, i.e., it worked exactly like the default linux terminal. as it later turned out, this is probably because how the kernel handles the VTs. still, i really find it strange that noone seems to be concerned about this. it leads me to the conclusion that people do everything under GUI environments, at which i'm greatly surprised, since if any linux, it's gentoo that should have the most CLI-fiend users.

take care
Back to top
View user's profile Send private message
Decibels
Veteran
Veteran


Joined: 16 Aug 2002
Posts: 1629
Location: U.S.A.

PostPosted: Thu Jan 08, 2004 1:28 am    Post subject: Reply with quote

Don't do that much. I do like a previous suggestion and pipe it to something like less when I use a non-gui 'cli' .
_________________
Support bacteria – they’re the only culture some people have.”

– Steven Wright
Back to top
View user's profile Send private message
IntergalacticWalrus
Guru
Guru


Joined: 07 Jan 2003
Posts: 513
Location: Montreal QC (Canada)

PostPosted: Thu Jan 08, 2004 5:28 am    Post subject: Reply with quote

What's the big deal with limited console size? Just use a terminal program under X11 and stop whining. The Linux terminal wasn't meant to be something you'd really do work on, unless you're a masochist or something. Besides there are many advantages to running an X11 terminal (especially a powerful one, ie. Konsole).
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum