Commit 9615dfa
authored
fix: forward signals and drop --new-session for TUI support (#15)
* fix: forward all relevant signals to sandboxed child process
Interactive/TUI apps (Claude Code, opencode) running inside greywall
could not respond to terminal resizes, and copy/paste line breaks were
broken.
Two issues were at play:
1. Only SIGINT and SIGTERM were forwarded to the child. Added SIGWINCH,
SIGQUIT, SIGHUP, SIGUSR1, SIGUSR2.
2. bwrap --new-session called setsid(), detaching the child from the
controlling terminal entirely. This prevented SIGWINCH delivery
regardless of forwarding. Removed --new-session and instead block
the TIOCSTI ioctl (terminal input injection) via the seccomp BPF
filter, which was the security concern --new-session addressed.
Closes #13
* fix: gofumpt formatting in seccomp TIOCSTI filter1 parent 2d17bfc commit 9615dfa
File tree
3 files changed
+67
-15
lines changed- cmd/greywall
- internal/sandbox
3 files changed
+67
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
370 | 370 | | |
371 | 371 | | |
372 | 372 | | |
373 | | - | |
| 373 | + | |
374 | 374 | | |
375 | 375 | | |
376 | 376 | | |
| |||
396 | 396 | | |
397 | 397 | | |
398 | 398 | | |
399 | | - | |
| 399 | + | |
400 | 400 | | |
401 | | - | |
402 | 401 | | |
403 | 402 | | |
404 | 403 | | |
405 | | - | |
406 | | - | |
407 | | - | |
408 | | - | |
409 | | - | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
410 | 411 | | |
| 412 | + | |
411 | 413 | | |
412 | 414 | | |
413 | 415 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
626 | 626 | | |
627 | 627 | | |
628 | 628 | | |
629 | | - | |
630 | | - | |
631 | | - | |
632 | | - | |
633 | | - | |
634 | | - | |
635 | | - | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
636 | 635 | | |
637 | 636 | | |
638 | 637 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
23 | 28 | | |
24 | 29 | | |
25 | 30 | | |
| |||
144 | 149 | | |
145 | 150 | | |
146 | 151 | | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
147 | 196 | | |
148 | 197 | | |
149 | 198 | | |
| |||
263 | 312 | | |
264 | 313 | | |
265 | 314 | | |
| 315 | + | |
266 | 316 | | |
267 | 317 | | |
268 | 318 | | |
| |||
294 | 344 | | |
295 | 345 | | |
296 | 346 | | |
| 347 | + | |
297 | 348 | | |
298 | 349 | | |
299 | 350 | | |
| |||
0 commit comments