fix(gui,os): harden terminal input handling and isolate background commands - #23
Conversation
β¦mmands - add async `InputReader` with per-keystroke sequence reassembly and bounded batch delivery - move fragmented escape/Cursor/report parsing logic and tests into new `src/gui/input.rs` - refactor main loop to consume event batches and centralize resize reflow handling - make spawned commands non-interactive (`GIT_TERMINAL_PROMPT=0`, `SSH_ASKPASS_REQUIRE=never`, optional `GIT_SSH_COMMAND`, `setsid`, stdin null) - add `libc` dependency for session-detaching background processes
|
this apparently fixed it. grok 4.5 btw |
There was a problem hiding this comment.
π‘ Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 95d3fe723f
βΉοΈ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with π.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| cmd.env(key, value); | ||
| } | ||
|
|
||
| make_non_interactive(&mut cmd); |
There was a problem hiding this comment.
Restrict non-interactive mode to background commands
When a foreground remote operation needs an HTTPS credential or an SSH key passphrase, this unconditional call makes it fail instead of prompting: GitCommands::fetch, pull, and push in src/git/remote.rs all use this same builder, while only fetch_all_background was previously marked non-interactive. Applying GIT_TERMINAL_PROMPT=0, SSH batch mode, setsid, and null stdin in every CmdBuilder::run also affects foreground custom commands; make this behavior opt-in for the actual background jobs.
Useful? React with πΒ / π.
| } | ||
| } | ||
| } | ||
| Err(_) => return, |
There was a problem hiding this comment.
Propagate input-reader failures to the main loop
If event::poll or event::read returns an error in the new reader thread, this branch silently terminates the worker; the channel then disconnects, but wait_batch treats disconnection exactly like an ordinary timeout. The main loop consequently keeps rendering forever while ignoring all keyboard and mouse input, so the user cannot quit or restore the terminal normally. Send the error through the channel or otherwise make disconnection terminate main_loop with an error.
Useful? React with πΒ / π.
InputReaderwith per-keystroke sequence reassembly and bounded batch delivery - move fragmented escape/Cursor/report parsing logic and tests into newsrc/gui/input.rs- refactor main loop to consume event batches and centralize resize reflow handling - make spawned commands non-interactive (GIT_TERMINAL_PROMPT=0,SSH_ASKPASS_REQUIRE=never, optionalGIT_SSH_COMMAND,setsid, stdin null) - addlibcdependency for session-detaching background processes