Set correct terminal size to improve login over serial port experience

Bug #1810578 reported by Mark Shuttleworth
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
base-files (Ubuntu)
New
Undecided
Unassigned

Bug Description

For people who use ipmiconsole or other serial port access to servers a great deal it would be helpful to set LINES and COLUMNS correctly on login. There are a number of ways to do this. I found a small (10k) C application at:

http://web.archive.org/web/20081224152013/http://www.davehylands.com/gumstix-wiki/resize/resize.c

which works nicely. It appears to be a simplified version of the resize command in xterm (which has too many dependencies for comfortable server usage). It seems quite old (2006) so there may be a better, newer version of this. Perhaps it would be better named tty-resize.

I added the following two lines to .profile which then invoke the resize command on login:

# size the terminal for login over serial
[[ $(tty) == /dev/ttyS* ]] & /usr/local/bin/resize

I think remote serial usage is interesting for cloud and server farm use cases which are a big part of Ubuntu usage, so would like to improve experience in these cases across the board. This is a small part of that.

Revision history for this message
Mark Shuttleworth (sabdfl) wrote :

Hmm... that .profile causes this on SSH logins, so needs tweaking:

Last login: Sat Jan 5 10:49:02 2019 from 192.168.4.70
[1]+ Exit 1 [[ $(tty) == /dev/ttyS* ]]
john@xx:~$

Revision history for this message
Mark Shuttleworth (sabdfl) wrote :

&& works better :)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.