Skip to content

Commit 75e5d49

Browse files
Brooooooklynclaude
andauthored
fix(cli): skip OSC color queries in tmux to prevent hang on launch (#945)
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>
1 parent bf2bbce commit 75e5d49

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

crates/vite_shared/src/header.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,12 @@ fn query_terminal_colors(palette_indices: &[u8]) -> (Option<Rgb>, Vec<(u8, Rgb)>
203203
return (None, vec![]);
204204
}
205205

206+
// tmux does not reliably forward OSC color query responses back to the
207+
// child process, causing the same hang-until-keypress behavior as Warp.
208+
if std::env::var_os("TMUX").is_some() {
209+
return (None, vec![]);
210+
}
211+
206212
let mut tty = match OpenOptions::new().read(true).write(true).open("/dev/tty") {
207213
Ok(file) => file,
208214
Err(_) => return (None, vec![]),

0 commit comments

Comments
 (0)