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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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.


share|improve this answer
Please don't just post a link: include the relevant detail so that the information is available here as well... – jasonwryan May 3 '14 at 0:51
Too bad it needs Python. – Craig McQueen Oct 31 '14 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

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
Shouldn’t it be possible to run a protocol over the serial line, that does offer all the features? I mean we do have a client and a server. They could use inband escape sequences to do just about everything, and still work with a plain text serial console! – Evi1M4chine Feb 2 at 14:35

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


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.