on master help sign in
Fix TUI size glitches: attach via exec -it so the guest gets a sized TTY
commita57a7ef2f40216f27d82f0888275d92b44a6ba1b authoriko <mail@iko.soy> dateSun 28 Jun 2026, 04:09 (3 months ago) parente39e63f
1 file changed+9−1
c+9−1
c+9−1
@@ -60,7 +60,15 @@ switch $argv[1]
6060 # recover (see prompt.fish) — TUIs need the matching terminfo entry.
6161 container create --name $name --ssh -it -e "HOST_TERM=$TERM" --memory 8g --cwd /workspace $mounts $argv $image
6262 case start
63− container start -ai $name
63+ # Boot the container detached (its PID1 fish keeps it alive), then attach
64+ # an interactive shell with `exec -it`. `container start -ai` has no `-t`
65+ # flag, so it never hands the guest a properly sized TTY: the real window
66+ # size isn't delivered via the TIOCGWINSZ ioctl, so ioctl-based TUIs
67+ # (crossterm/ncurses — helix, zellij, btop…) see 0×0 and render garbled,
68+ # misaligned output. `exec -it` opens a real, correctly sized TTY.
69+ container start $name >/dev/null 2>&1; or exit 1
70+ container exec -it --cwd /workspace $name \
71+ /bin/fish --no-config --init-command "source /etc/fish/prompt.fish"
6472 case '*'
6573 echo "usage: c init [-c FILE] [create args] | start" >&2
6674 exit 1