I'm implementing a web-based, shared Linux terminal (using term.js), and one issue I'm facing is the potential screen size differences of various connected users. For e.g. if I set export COLUMNS=160
, then people with small screens have badly formatted output when they do a ls
etc.
I know screen
allows you to share terminals - how does screen account for change in resolutions of individual users?
On terminals with more lines than screen
's current height, the "logical" bottom of the screen is marked with a line of dashes. On terminals with less characters than screen
's current width, lines are truncated or also badly formatted. Having users have different terminal sizes is always a mess. screen
fortunately has the command
Ctrl-A
F
(fit): Resize the window to the current region size.
This allows a user to override a previous user's insane setting.