Skip to content

fix: restore terminal after force closing Codex - #114

Open
ducky-duke wants to merge 1 commit into
Lampese:mainfrom
ducky-duke:fix/restore-terminal-after-force-close
Open

fix: restore terminal after force closing Codex#114
ducky-duke wants to merge 1 commit into
Lampese:mainfrom
ducky-duke:fix/restore-terminal-after-force-close

Conversation

@ducky-duke

Copy link
Copy Markdown

Summary

  • capture each targeted Unix process's controlling TTY before force-killing the Codex process tree
  • restore Codex's keyboard-reporting and cursor modes on that TTY after every associated target has terminated
  • validate /dev paths and character devices, open with O_NOCTTY, and skip restoration when a kill partially fails
  • add unit coverage for Unix ps parsing, TTY path sanitization, and target grouping

Why

Codex enables enhanced CSI-u keyboard reporting while its TUI is active. A SIGKILL bypasses normal TUI cleanup, so VS Code's terminal can remain in that mode and send encoded key sequences to the restored shell; typing and Enter then appear broken.

Validation

  • cargo test --locked --manifest-path src-tauri/Cargo.toml — 34 passed in a clean Linux container with the Tauri system dependencies
  • cargo fmt --manifest-path src-tauri/Cargo.toml --check
  • pnpm build
  • pnpm test:reset-credits — 3 passed
  • git diff --check

cargo clippy --all-targets -- -D warnings could not run to completion on the host because the WebKitGTK/JavaScriptCoreGTK development packages required by Tauri are not installed. The full Rust test suite compiled and passed in the dependency-complete container.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant