# v0.6.0

## Terminal resize finally works; --exec quiet mode; color bleeding fix

### Fix: terminal resize (SIGWINCH) now works reliably

Previously, resizing the terminal while a child process was running inside the sandbox had multiple issues: blank space when maximizing, line overflow when shrinking, and child programs not knowing about size changes at all.

Root causes fixed:

- **`--new-session` blocked SIGWINCH delivery**: bwrap's `--new-session` calls `setsid()`, creating a new session with no controlling terminal. This completely prevented SIGWINCH from reaching child processes via `TIOCSWINSZ` on the PTY master. Fixed by skipping `--new-session` when stdin is a terminal (interactive use). Non-interactive invocations (piped input) still use `--new-session` for process isolation.

- **`SA_RESTART` delayed resize processing**: The SIGWINCH signal handler used `SA_RESTART`, which caused `poll()` to silently restart instead of returning `EINTR`. This delayed resize processing by up to 100ms (the poll timeout). SIGWINCH now uses `SaFlags::empty()` so `poll()` returns immediately.

- **Primary screen resize showed stale content**: On the primary screen (non-alt-screen programs), the resize handler was re-rendering stale vt100 buffer content. Now it just clears the screen and sets the scroll region, letting the child redraw naturally.

### Fix: color bleeding from split escape sequences

When a `read()` boundary splits a child's ANSI escape sequence (e.g., `\x1b[38;2;255` in one chunk, `;128;0m` in the next), injecting scroll region management sequences between the chunks would corrupt both sequences, causing color bleeding. A new `ends_at_ground_state()` function now guards injection — scroll region sequences are only inserted when the output stream is in a clean state.

### Enhancement: --exec quiet mode

The `--exec` flag now fully suppresses ai-jail's own output (sandbox info, mount warnings) by propagating the `AI_JAIL_QUIET` environment variable through bwrap to the inner landlock-exec process.

### Security hardening (from v0.5.4+)

- seccomp-bpf syscall filter blocks dangerous syscalls
- Resource limits (NPROC, NOFILE, CORE) prevent fork bombs and resource exhaustion
- Landlock V4 with network rules
- Sensitive `/sys` paths masked with tmpfs overlays

### PTY rendering improvements (from v0.5.5+)

- Hybrid rendering: scrollback-based on primary screen, state_diff on alt screen
- Fixed cursor jumping to top on every output
- Clear screen at startup to prevent stale content
