Sample Header Ad - 728x90

screen /dev/pts/<num> of a VM never has correct stty settings

0 votes
2 answers
1022 views
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/ I use screen as a way to interact with /dev/pts/, as it has proven better than cat /dev/pts/ & cat > /dev/pts/ 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/ 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/ 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 = ; eol2 = ; swtch = ; 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 = ; eol2 = ; swtch = ; 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
Asked by fraleone (897 rep)
Nov 16, 2020, 12:25 PM
Last activity: Dec 20, 2020, 12:10 PM