As noted by @Ruslan, one of the answers to How to get terminal window width? mentions that the usual way to get the screensize via a system call does not work over a serial line.
If minicom
supported the VT100 cursor-position report, then you could use resize
on the remote shell command-line to set the size. resize
uses the cursor-position report to determine the actual size of the screen, prints the result and (the point of this question) updates the terminal settings which tell other applications what the screen size is. That only lasts for the current connection. You can see the effect using the stty
command. In this example, my window is 40x80:
$ resize;stty -a
set noglob;
setenv COLUMNS '80';
setenv LINES '40';
unset noglob;
speed 38400 baud; rows 40; columns 80; line = 0;
intr = ^C; quit = ^\; erase = ^H; kill = ^U; eof = ^D; eol = <undef>;
eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; discard = ^O; min = 1; time = 0;
-parenb -parodd -cmspar cs8 -hupcl -cstopb cread -clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff
-iuclc -ixany -imaxbel iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt
echoctl echoke -flusho -extproc
The question is unclear (there are several copies of minicom), at least the Debian source for it seems to support that (look for 'n'
as a start).