fix(tui2): align Steer submit keys (#9218)

- Remove legacy Ctrl+K queuing in tui2; Tab is the queue key.
- Make Enter queue when Steer is disabled and submit immediately when
Steer is enabled.
- Add Steer keybinding docs on both tui and tui2 chat composers.
This commit is contained in:
Josh McKinney
2026-01-14 11:35:55 -08:00
committed by GitHub
Unverified
parent e6d2ef432d
commit 0471ddbe74
2 changed files with 19 additions and 10 deletions
@@ -195,6 +195,7 @@ pub(crate) struct ChatComposer {
context_window_used_tokens: Option<i64>,
skills: Option<Vec<SkillMetadata>>,
dismissed_skill_popup_token: Option<String>,
/// When enabled, `Enter` submits immediately and `Tab` requests queuing behavior.
steer_enabled: bool,
}
@@ -258,6 +259,12 @@ impl ChatComposer {
self.skills = skills;
}
/// Enables or disables "Steer" behavior for submission keys.
///
/// When steer is enabled, `Enter` produces [`InputResult::Submitted`] (send immediately) and
/// `Tab` produces [`InputResult::Queued`] (eligible to queue if a task is running).
/// When steer is disabled, `Enter` produces [`InputResult::Queued`], preserving the default
/// "queue while a task is running" behavior.
pub fn set_steer_enabled(&mut self, enabled: bool) {
self.steer_enabled = enabled;
}
+12 -10
View File
@@ -201,6 +201,7 @@ pub(crate) struct ChatComposer {
transcript_copy_feedback: Option<TranscriptCopyFeedback>,
skills: Option<Vec<SkillMetadata>>,
dismissed_skill_popup_token: Option<String>,
/// When enabled, `Enter` submits immediately and `Tab` requests queuing behavior.
steer_enabled: bool,
}
@@ -269,6 +270,12 @@ impl ChatComposer {
self.skills = skills;
}
/// Enables or disables "Steer" behavior for submission keys.
///
/// When steer is enabled, `Enter` produces [`InputResult::Submitted`] (send immediately) and
/// `Tab` produces [`InputResult::Queued`] (eligible to queue if a task is running).
/// When steer is disabled, `Enter` produces [`InputResult::Queued`], preserving the default
/// "queue while a task is running" behavior.
pub fn set_steer_enabled(&mut self, enabled: bool) {
self.steer_enabled = enabled;
}
@@ -1493,20 +1500,14 @@ impl ChatComposer {
kind: KeyEventKind::Press,
..
} => self.handle_submission(true),
KeyEvent {
code: KeyCode::Char('k'),
modifiers: KeyModifiers::CONTROL,
kind: KeyEventKind::Press,
..
} => {
// Tab queues the message instead of submitting immediately
self.handle_submission(true)
}
KeyEvent {
code: KeyCode::Enter,
modifiers: KeyModifiers::NONE,
..
} => self.handle_submission(false),
} => {
let should_queue = !self.steer_enabled;
self.handle_submission(should_queue)
}
input => self.handle_input_basic(input),
}
}
@@ -2905,6 +2906,7 @@ mod tests {
"Ask Codex to do anything".to_string(),
false,
);
composer.set_steer_enabled(true);
let _ = composer.handle_key_event(KeyEvent::new(KeyCode::Char('あ'), KeyModifiers::NONE));