Skip to content

Commit 5e01dd3

Browse files
committed
fix(tui): Shift+Tab no longer shows [bash] mode indicator
CC's Shift+Tab (chat:cycleMode) cycles PERMISSION modes (default→acceptEdits→auto→plan), not input modes. Remove the incorrect PromptInputMode cycling and [bash] prefix display. CycleMode is now a no-op until permission mode switching is wired through the agent layer.
1 parent 2282bdf commit 5e01dd3

1 file changed

Lines changed: 18 additions & 19 deletions

File tree

crates/tui/src/app.rs

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -362,13 +362,9 @@ impl App {
362362
self.scroll_to_search_match();
363363
return AppAction::None;
364364
}
365-
Action::CycleMode if self.state != AppState::Confirming => {
366-
self.cycle_input_mode();
367-
return AppAction::None;
368-
}
369-
Action::Redraw => {
370-
// Force redraw is handled by the outer loop re-rendering;
371-
// returning None triggers a repaint on the next frame.
365+
// CycleMode: CC cycles permission modes. Needs agent integration.
366+
// Redraw: handled by outer loop on next frame.
367+
Action::CycleMode | Action::Redraw => {
372368
return AppAction::None;
373369
}
374370
// These actions are recognized but currently act as no-ops
@@ -993,23 +989,24 @@ fn render_unseen_divider(count: usize, area: Rect, buf: &mut Buffer) {
993989

994990
/// Render input with `❯` prompt and mode indicator — no border box (matches CC's flat style).
995991
#[allow(clippy::cast_possible_truncation)]
996-
fn render_input_with_prompt(input: &InputBox, mode: PromptInputMode, area: Rect, buf: &mut Buffer) {
992+
fn render_input_with_prompt(
993+
input: &InputBox,
994+
_mode: PromptInputMode,
995+
area: Rect,
996+
buf: &mut Buffer,
997+
) {
997998
if area.height == 0 || area.width < 4 {
998999
Widget::render(input, area, buf);
9991000
return;
10001001
}
10011002

1002-
// Mode indicator label: shown only for non-default modes
1003-
let mode_prefix = match mode {
1004-
PromptInputMode::Prompt => String::new(),
1005-
other => format!("[{}] ", other.label()),
1006-
};
1007-
let prefix_width = mode_prefix.len() as u16;
1003+
// No mode indicator — CC shows permission mode elsewhere (status line)
1004+
let prefix_width = 0u16;
10081005

1009-
// Mode indicator
1010-
if !mode_prefix.is_empty() {
1006+
// Placeholder for future mode indicator
1007+
if false {
10111008
let mode_span = Span::styled(
1012-
&mode_prefix,
1009+
"",
10131010
Style::default()
10141011
.fg(Color::Yellow)
10151012
.add_modifier(Modifier::BOLD),
@@ -2203,7 +2200,8 @@ mod tests {
22032200
}
22042201

22052202
#[test]
2206-
fn render_input_with_bash_mode() {
2203+
fn render_input_no_mode_prefix() {
2204+
// Mode indicator was removed — all modes render the same ❯ prompt
22072205
let input = InputBox::new();
22082206
let area = Rect::new(0, 0, 40, 1);
22092207
let mut buf = Buffer::empty(area);
@@ -2212,7 +2210,8 @@ mod tests {
22122210
let text: String = (0..area.width)
22132211
.map(|x| buf.cell((x, 0)).unwrap().symbol().to_string())
22142212
.collect();
2215-
assert!(text.contains("[bash]"));
2213+
assert!(!text.contains("[bash]"));
2214+
assert!(text.contains('❯'));
22162215
}
22172216

22182217
#[test]

0 commit comments

Comments
 (0)