Commit 83d90f7
committed
Fix ncurses resize by seeding PTY size via stty, not env vars
Setting LINES/COLUMNS in the child environment was freezing ncurses
apps like htop at their start-up size: ncurses treats those env vars
as an explicit user override of the kernel-reported window size, so
the TIOCGWINSZ updates that SIGWINCH triggers were ignored and the app
kept drawing at the original dimensions after a window resize. Child
processes launched from inside the ncurses app also inherited the
stale values.
Drop LINES/COLUMNS from the prepared environment and instead bake the
initial size into the shell wrapper via `stty rows N columns N` before
exec. The kernel PTY winsize is now the single source of truth,
set-process-window-size continues to handle live resizes, and ncurses
apps pick up the new size normally on SIGWINCH.
Adds a regression test that spawns a real /bin/sh through
ghostel--start-process, asserts the stty wrapper contains the pinned
rows/columns, and asserts the prepared environment has no LINES or
COLUMNS entries.
Fixes #671 parent 144c9ba commit 83d90f7
2 files changed
Lines changed: 40 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2175 | 2175 | | |
2176 | 2176 | | |
2177 | 2177 | | |
2178 | | - | |
| 2178 | + | |
| 2179 | + | |
| 2180 | + | |
2179 | 2181 | | |
2180 | 2182 | | |
2181 | 2183 | | |
| |||
2187 | 2189 | | |
2188 | 2190 | | |
2189 | 2191 | | |
2190 | | - | |
2191 | | - | |
2192 | | - | |
| 2192 | + | |
2193 | 2193 | | |
2194 | 2194 | | |
2195 | 2195 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2093 | 2093 | | |
2094 | 2094 | | |
2095 | 2095 | | |
| 2096 | + | |
| 2097 | + | |
| 2098 | + | |
| 2099 | + | |
| 2100 | + | |
| 2101 | + | |
| 2102 | + | |
| 2103 | + | |
| 2104 | + | |
| 2105 | + | |
| 2106 | + | |
| 2107 | + | |
| 2108 | + | |
| 2109 | + | |
| 2110 | + | |
| 2111 | + | |
| 2112 | + | |
| 2113 | + | |
| 2114 | + | |
| 2115 | + | |
| 2116 | + | |
| 2117 | + | |
| 2118 | + | |
| 2119 | + | |
| 2120 | + | |
| 2121 | + | |
| 2122 | + | |
| 2123 | + | |
| 2124 | + | |
| 2125 | + | |
| 2126 | + | |
| 2127 | + | |
| 2128 | + | |
| 2129 | + | |
| 2130 | + | |
| 2131 | + | |
2096 | 2132 | | |
2097 | 2133 | | |
2098 | 2134 | | |
| |||
0 commit comments