PTY Resize
Resize the window and your programs follow -- SIGWINCH propagates and the emulator reflows.
What you'll see
- Launch rysh and print the size with
echo cols=$(tput cols) rows=$(tput lines). - Split with
Ctrl+P n, changing pane geometry and firing SIGWINCH. - Re-run the
tputecho in the narrower pane to show the reduced column count. - Launch
htopto show an interactive program reflowing, thenqto quit.
Commands shown
rysh
echo cols=$(tput cols) rows=$(tput lines)
n
echo cols=$(tput cols) rows=$(tput lines)
htop
q
Keys used
Transcript
0:00Resize the window and your programs follow -- SIGWINCH propagates and the emulator reflows.
0:03Start rysh and check the terminal dimensions.
0:08Run tput to read the current columns and rows -- the values the PTY is reporting to your shell.
0:15Split a pane with Ctrl+P n. Splitting changes each pane's geometry, and Rysh sends a SIGWINCH so the shell learns its new size.
0:23Check again in the narrower pane -- the column count has dropped. The PTY was resized live, no restart needed.
0:30Interactive programs adapt too. Launch htop -- the vt10x emulator reflows its layout to whatever space the pane currently has.
0:37Resize freely. Your shells and full-screen apps reflow to fit.