From d86e10fd80d2c0baf46ea28afc8c8f225f2c7dc3 Mon Sep 17 00:00:00 2001 From: LongYinan Date: Mon, 16 Mar 2026 15:03:49 +0800 Subject: [PATCH] fix(cli): skip OSC color queries in tmux to prevent hang on launch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- crates/vite_shared/src/header.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/vite_shared/src/header.rs b/crates/vite_shared/src/header.rs index 8c6f508a1f..92c01dcd82 100644 --- a/crates/vite_shared/src/header.rs +++ b/crates/vite_shared/src/header.rs @@ -203,6 +203,12 @@ fn query_terminal_colors(palette_indices: &[u8]) -> (Option, Vec<(u8, Rgb)> return (None, vec![]); } + // tmux does not reliably forward OSC color query responses back to the + // child process, causing the same hang-until-keypress behavior as Warp. + if std::env::var_os("TMUX").is_some() { + return (None, vec![]); + } + let mut tty = match OpenOptions::new().read(true).write(true).open("/dev/tty") { Ok(file) => file, Err(_) => return (None, vec![]),