Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

When using the serial console of my system I always end up with $COLUMNS=80 and $LINES=24.

While I can change these variables manually it is somewhat annoying to do this any time when the client side terminal window has been resized.

Usually I'm connecting to the console using screen /dev/mytty baudrate.

Changing the $TERM environment variable to "screen" or "xterm" does not help.

Will I need to call getty with some of those instead of vt100?

Needless to say that all of this works fine, when I connect to the same machine using ssh.

share|improve this question

3 Answers 3

Here is another solution that worked great for me on my embedded Linux system (Overo running Angstrom). I just ran it from my .bashrc file. I didn't want to use resize because that requires installing some X packages, and I didn't want that.

http://shallowsky.com/blog/tags/embedded/

share|improve this answer
1  
Please don't just post a link: include the relevant detail so that the information is available here as well... –  jasonwryan May 3 at 0:51
    
Too bad it needs Python. –  Craig McQueen Oct 31 at 4:52

Just for the record, here is the answer to this Problem (Usenet won):

Console Applications running inside virtual terminal applications (xterm, rxvt and friends) will receive SIGWINCH after a resize operation has taken place. Thus the application will be able to redraw the window etc. in the corresponding signal handler.

Unfortunately when using a serial console, there is no such mechanism.

It is however possible for the application to actively ask for the current console Window size. So the second best thing is to do this every time a command prompt is printed by the shell.

In bash this can be achieved using the following in bashrc:

if [ $(tty) == '/dev/ttyS0' ]; then
  trap resize DEBUG
fi

The actual sourcecode of the resize command can be found here.

Of course this will not change the console size settings in a console application during runtime.

share|improve this answer

Why not try minicom, kermit or gtkterm, I don't think they have that problem?

share|improve this answer
    
Nope, this does not seem to be a Problem of the Client side. It does not matter if minicom or screen is used. –  Sven Geggus Jul 13 '11 at 14:06

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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