aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-21 15:45:58 +0000
committertv <tv@krebsco.de>2026-11-21 15:45:58 +0000
commit4148b4543c7d776d3428d01497cfc9de3ae7c9f7 (patch)
tree2a82a076cffdd3904ecd293d122ab788b2b2289c /README.md
parent4dd6ea85895430c1ef231c0f5ec1437bcb7ff0e9 (diff)
layers/console.nix: the console's size follows the terminal's
A serial line, unlike a pty, doesn't get told when the terminal's size changes, so the console kept the size the run script saw at boot (systemd.tty.rows/columns.ttyS0), e.g. 6 rows, from a tmux pane that small for a moment, and a tmux attached there drew for that, whatever the terminal's size. Now there's resize, which asks the terminal (ESC[6n, after moving the cursor as far as it goes, then back) and sets what it answers (stty rows, cols), and the shell on the serial console runs it before each prompt, until the terminal doesn't answer (within a second). A tmux attached there still keeps its size until attached again.
Diffstat (limited to 'README.md')
-rw-r--r--README.md5
1 files changed, 5 insertions, 0 deletions
diff --git a/README.md b/README.md
index 3ee09f0..478beb2 100644
--- a/README.md
+++ b/README.md
@@ -92,6 +92,11 @@ of its own, import it into another layer:
(As a layer of its own, it works, too: `--arg layers '[ layers/console.nix ]'`.)
+A serial console doesn't get told when the terminal's size changes, so
+the shell there asks the terminal before each prompt (`resize`, which
+works in tmux, too). A tmux attached on the console keeps the size it
+started with: detach and attach again after resizing.
+
Leave the guest with `reboot` (there, or via ssh, see below).
The guest's store is read-only, and there's no nix, unless it has the