Skip to content

Instantly share code, notes, and snippets.

@vdm
Created July 19, 2023 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vdm/3e5218bf085f1c74f74f53eaf096f918 to your computer and use it in GitHub Desktop.
Save vdm/3e5218bf085f1c74f74f53eaf096f918 to your computer and use it in GitHub Desktop.
Serial console resizing

Unlike ssh, serial consoles like virsh console don’t receive SIGWINCH and so instead of resizing they stay stuck at 80x24, making line wrapping, tab completion, curses and reading in a pager difficult.

So get the terminal size from the outside bash shell, and set the same values manually within the serial console:

host$ echo $LINES $COLUMNS
182 92
host$ sudo virsh console guest
guest$ stty rows 182 cols 92
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment