A virtual machine (using linux+kvm+qemu) is setup to provided a serial port for a terminal, which is made available via a pseudo-terminal, some random /dev/pts/<number>
I use screen as a way to interact with /dev/pts/<number>
, as it has proven better than
cat /dev/pts/<number> & cat > /dev/pts/<number>
which did not correctly handle escapes like ctrl-c
, or echoed input multiple times.
The issue and core of this question is that the settings of the "tty/pts" as inquired via stty --all
inside the shell wihtin screen /dev/pts/<number>
does not have the correct settings with respect to the dimensinos (cols
and rows
) which effectively causes headache by incorrect line-wrapping etc inside the shell of the VM.
Since there is more than 1 machine and terminal/tty/pts at play here I am not experienced enought to understand how to setup the correct settings.
How can the screen /dev/pts/<number>
shell be made aware of the correct stty
settings?
** Update **
The output of stty --all
within the shell of the vm is.
root@mail:~# stty --all
speed 115200 baud; rows 24; columns 80; line = 0;
intr = ^C; quit = ^\; erase = ^?; 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 output of stty --all
in the shell of the hosting system is
speed 38400 baud; rows 39; columns 147; line = 0;
intr = ^C; quit = ^\; erase = ^?; 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
stty --all
and say what the correct setting should be? – Eduardo Trápani Dec 12 '20 at 17:53stty --all
as it output when (a) within the vm (i.e. via the pts interface) and (b) how it is nomally on the host system. – fraleone Dec 12 '20 at 22:07cols
androws
are set to the correct values147
and39
respectively – fraleone Dec 12 '20 at 22:14stty cols XX rows YY
? If theserial port
prevents that, why does it yet work behind assh connection
, to what I uderstand in both cases the SHELL is run remotely (i.e. not where the terminal emulator is?) – fraleone Dec 14 '20 at 08:13