I followed this tutorial and now I'm able to connect to serial line. Now I want to change the width of terminal. How can I do this by using screen or minicom or something else?
Asked
Active
Viewed 1.2e+01k times
2 Answers
124
Serial connections don't have a standard way of setting terminal geometry. The assumed geometry is often 80x23 or 80x24 (terminals with zero to two status lines).
Once you're logged in, you can set your preferred geometry via the shell, using something like
stty rows 50 cols 132
This will last for the duration of your terminal session, but is not persistent across terminal sessions (e.g. logging out and logging in again).
Unfortunately, resizing the GUI window the terminal emulator runs in won't update this unless some cunning magic is taking place I'm entirely unaware of.

Alexios
- 19,157
16
Instead of launching minicom by typing:
minicom
type the following instead:
TERM=linux minicom
-
Maybe/maybe not: minicom doesn't do anything with that value; you may have some application that assumes a particular geometry and sets the terminal size using
stty
. – Thomas Dickey Oct 15 '17 at 10:42 -
1I don't understand why, but hell it works exactly the way I want! Thank you sir! I suggest making alias in /etc/.bashrc for anyone that uses it frequently:: alias='TERM=linux minicom -s – While-E Mar 19 '18 at 17:57
-
@While-E, your alias is incorrect. Should it be
alias TERM='linux minicom -s'
?? – lordhog Apr 18 '18 at 00:49 -
Above aliases don't work for me. Instead use
alias minicom='TERM=linux minicom'
(works w/ bash 4.4.12 in GNU/Linux Debian 9.6 stretch). – Elliptical view Feb 28 '19 at 03:18 -
1This specification of
TERM
works fine for e.g.vim
,journalctl
and some other programs, but not forman
,gdb
and maybe some more. For these I had to usestty cols 316 rows 94
. – Ruslan Aug 25 '20 at 20:45
sh
might say thing likestty: number 0 is not in 1..2147483647 range
, setting to the maximum number would be silently ignored. But e.g. 500 works. – Hi-Angel Aug 18 '15 at 10:09