Skip to content

Commit 967eb91

Browse files
MrFlounderclaude
andcommitted
fix(ws): avoid shell init prompts eating command keystrokes after respawn-pane
After tmux respawn-pane, zsh plugins like oh-my-zsh can show interactive prompts (e.g. "Would you like to update? [Y/n]") that consume the first character(s) of send-keys input, causing "clear" to become "lear". Instead of send-keys, pass the command directly to respawn-pane as a shell argument, followed by `exec $SHELL` to drop into an interactive shell when the command exits. This bypasses the input buffer entirely. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 7e6b8b2 commit 967eb91

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

src/crabcode

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1510,9 +1510,12 @@ EOF
15101510
sleep 0.3
15111511
[ -n "$dev_cmd" ] && tmux send-keys -t "$SESSION_NAME:$window_name.$p_server" "$dev_cmd" C-m
15121512

1513-
tmux respawn-pane -k -t "$SESSION_NAME:$window_name.$p_main" -c "$dir"
1514-
sleep 0.5
1515-
[ -n "$claude_cmd" ] && tmux send-keys -t "$SESSION_NAME:$window_name.$p_main" "clear && $claude_cmd" C-m
1513+
if [ -n "$claude_cmd" ]; then
1514+
# Run command via respawn-pane shell arg to avoid zsh init prompts eating keystrokes
1515+
tmux respawn-pane -k -t "$SESSION_NAME:$window_name.$p_main" -c "$dir" "$claude_cmd; exec $SHELL"
1516+
else
1517+
tmux respawn-pane -k -t "$SESSION_NAME:$window_name.$p_main" -c "$dir"
1518+
fi
15161519

15171520
success "Workspace $num started with ticket prompt"
15181521
else
@@ -1962,9 +1965,12 @@ continue_workspace() {
19621965
sleep 0.3
19631966
[ -n "$dev_cmd" ] && tmux send-keys -t "$SESSION_NAME:$window_name.$p_server" "$dev_cmd" C-m
19641967

1965-
tmux respawn-pane -k -t "$SESSION_NAME:$window_name.$p_main" -c "$dir"
1966-
sleep 0.5
1967-
[ -n "$claude_cmd" ] && tmux send-keys -t "$SESSION_NAME:$window_name.$p_main" "clear && $claude_cmd" C-m
1968+
if [ -n "$claude_cmd" ]; then
1969+
# Run command via respawn-pane shell arg to avoid zsh init prompts eating keystrokes
1970+
tmux respawn-pane -k -t "$SESSION_NAME:$window_name.$p_main" -c "$dir" "$claude_cmd; exec $SHELL"
1971+
else
1972+
tmux respawn-pane -k -t "$SESSION_NAME:$window_name.$p_main" -c "$dir"
1973+
fi
19681974

19691975
success "Workspace $num continued with previous session"
19701976
else

0 commit comments

Comments
 (0)