fix: resolve vp hanging on launch in Warp terminal#762
Merged
Brooooooklyn merged 1 commit intomainfrom Mar 10, 2026
Merged
Conversation
✅ Deploy Preview for viteplus-staging canceled.
|
✅ Deploy Preview for viteplus-staging canceled.
|
84eb869 to
2f5b913
Compare
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
fengmk2
approved these changes
Mar 10, 2026
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
## Background The global `vp` CLI appeared to hang in Warp terminal, requiring a keypress before any output was displayed. This affected both the bare `vp` command (interactive picker) and subcommands like `vp create` that delegate to Node.js. The issue did not occur in other terminals such as iTerm2 or Terminal.app. ## Root Cause `vite_shared::header::vite_plus_header()` calls `query_terminal_colors()` which sends OSC escape sequences (`\x1b]10;?\x1b\\` for foreground color and `\x1b]4;N;?\x1b\\` for palette colors) to `/dev/tty` in raw mode to read the terminal's color values for the header gradient. Most terminals respond to these queries, but Warp's block-mode renderer does not. The function then blocks on `poll()`/`read()` waiting for a response that never comes, consuming the next keypress as a fake "response" instead. Since the header is rendered on nearly every command, this caused the CLI to appear stuck on every invocation in Warp. ## Fix 1. **Skip OSC color queries in Warp** (`header.rs`): Early-return from `query_terminal_colors()` when `TERM_PROGRAM=WarpTerminal`, falling back to default blue/magenta colors. This matches the existing CI environment skip pattern. 2. **Use alternate screen for the picker** (`command_picker.rs`): Switch the interactive command picker to use `EnterAlternateScreen` / `LeaveAlternateScreen` instead of `Clear(ClearType::All)` + manual cursor reset. This is standard TUI practice and avoids a large blank area that Warp's block-mode renderer created with the previous clear-based approach. 3. **Conditional padding for Warp** (`command_picker.rs`): Warp renders alternate screen content flush against the edges. Add a 1-line top margin and 1-space left margin only when running in Warp to improve readability, without affecting other terminals. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2f5b913 to
5bebc95
Compare
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Member
Author
Merge activity
|
fengmk2
pushed a commit
that referenced
this pull request
Mar 16, 2026
) tmux does not reliably forward OSC color query responses back to child processes, causing the CLI to appear stuck until a keypress is consumed as a fake response — the same issue fixed for Warp terminal in #762. Closes #822 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Low risk: adds an early-return guard in header color probing based on the `TMUX` env var, only affecting optional terminal color detection/formatting. > > **Overview** > Prevents the header color-probing routine (`query_terminal_colors`) from sending OSC color queries when inside *tmux* by short-circuiting if `TMUX` is set, matching the existing Warp terminal workaround. > > This avoids a launch-time hang where tmux may not forward OSC query responses back to the child process, at the cost of falling back to default header colors under tmux. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit d86e10f. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Background
The global
vpCLI appeared to hang in Warp terminal, requiring akeypress before any output was displayed. This affected both the bare
vpcommand (interactive picker) and subcommands likevp createthatdelegate to Node.js. The issue did not occur in other terminals such as
iTerm2 or Terminal.app.
Root Cause
vite_shared::header::vite_plus_header()callsquery_terminal_colors()which sends OSC escape sequences (
\x1b]10;?\x1b\\for foreground colorand
\x1b]4;N;?\x1b\\for palette colors) to/dev/ttyin raw mode toread the terminal's color values for the header gradient. Most terminals
respond to these queries, but Warp's block-mode renderer does not. The
function then blocks on
poll()/read()waiting for a response thatnever comes, consuming the next keypress as a fake "response" instead.
Since the header is rendered on nearly every command, this caused the
CLI to appear stuck on every invocation in Warp.
Fix
Skip OSC color queries in Warp (
header.rs): Early-return fromquery_terminal_colors()whenTERM_PROGRAM=WarpTerminal, fallingback to default blue/magenta colors. This matches the existing CI
environment skip pattern.
Use alternate screen for the picker (
command_picker.rs): Switchthe interactive command picker to use
EnterAlternateScreen/LeaveAlternateScreeninstead ofClear(ClearType::All)+ manualcursor reset. This is standard TUI practice and avoids a large blank
area that Warp's block-mode renderer created with the previous
clear-based approach.
Conditional padding for Warp (
command_picker.rs): Warp rendersalternate screen content flush against the edges. Add a 1-line top
margin and 1-space left margin only when running in Warp to improve
readability, without affecting other terminals.
Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com
Note
Medium Risk
Touches terminal I/O and TUI screen-management paths, which can regress rendering or leave terminals in a bad state if edge cases are missed, but changes are scoped to UI behavior and add explicit cleanup/error handling.
Overview
Fixes
vpappearing to hang in Warp by detecting Warp (TERM_PROGRAM=WarpTerminal) and skipping OSC color queries invite_shared::header::query_terminal_colors, falling back to default header colors.Updates the interactive command picker to use the terminal alternate screen (
EnterAlternateScreen/LeaveAlternateScreen) with safer event/error handling, and adds Warp-specific padding plus a viewport-size adjustment (compute_viewport_sizenow accounts for header overhead; tests updated accordingly).Written by Cursor Bugbot for commit 5bebc95. This will update automatically on new commits. Configure here.