fix(cli): prevent TTY hang during command delegation (#1396)#1422
fix(cli): prevent TTY hang during command delegation (#1396)#1422Han5991 wants to merge 7 commits intovoidzero-dev:mainfrom
Conversation
✅ Deploy Preview for viteplus-preview canceled.
|
3dc99eb to
e965560
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9a5ccb10a8
ℹ️ 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".
|
@codex review |
|
@Han5991 The amount of changes currently is a bit too large. Why wasn't the solution mentioned here #1396 (comment) considered? |
|
Codex Review: Didn't find any major issues. Breezy! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
You're right that the earlier change set was broader than it needed to be. I did try the Option 1 approach from #1396 by adding the foreground-process-group check in I also should have evaluated Option 2 from that comment earlier. I did not give that path I've since dropped those CLI-side header workarounds and kept the fix localized to The current change uses the Option 2-style approach instead: the terminal color query now |
…r header evaluation (voidzero-dev#1396) Commands like `vp run` or `vp test` running under background/reporter environments (e.g., lefthook with certain Node.js versions) would hang due to `query_terminal_colors()` blocking on `/dev/tty`. The root cause was `apply_custom_help()` eagerly evaluating the `vite_plus_header()` (and its OSC queries) to build the clap help template during argument parsing, prior to command dispatch. This commit: - Removes the eager header evaluation from clap help templates. - Prints the dynamic `vite_plus_header()` lazily only on `ErrorKind::DisplayHelp`. - Explicitly passes `dynamic_colors` flags into `print_runtime_header()`, allowing delegate commands to safely use `vite_plus_header_static()` right before execution without blocking on TTY queries.
c5a03ba to
22978f1
Compare
Resolves #1396
Description
Commands like
vp runorvp testrunning under background/reporter environments (e.g., lefthook with certain Node.js versions) would hang due toquery_terminal_colors()blocking on/dev/tty.The root cause was
apply_custom_help()eagerly evaluating thevite_plus_header()(and its OSC queries) to build the clap help template during argument parsing, prior to command dispatch.This commit:
vite_plus_header()lazily only onErrorKind::DisplayHelp.dynamic_colorsflags intoprint_runtime_header(), allowing delegate commands to safely usevite_plus_header_static()right before execution without blocking on TTY queries.