Skip to content

Commit d30a7f5

Browse files
factorydroidFactory Bot
authored andcommitted
fix(tui): enable help key shortcut '?' in input mode
Fixes bounty issue #1535 The '?' key (Shift+/) was previously consumed by the input widget as text input, preventing the global Help action from triggering. This change prioritizes the Help action check before text input processing, ensuring the help overlay can be accessed even when the input field is focused.
1 parent ee89f3c commit d30a7f5

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

cortex-tui/src/runner/event_loop.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1357,6 +1357,16 @@ impl EventLoop {
13571357
let context = self.get_action_context();
13581358
let action = self.action_mapper.get_action(key_event, context);
13591359

1360+
// Handle global Help action explicitly, even in input context
1361+
// This ensures '?' triggers help even when typing, but only if it's Shift+/ (?)
1362+
// and not just typing text. Since '?' is mapped to Help action, we prioritize it
1363+
// unless it's being handled by autocomplete or other specific logic.
1364+
if action == KeyAction::Help {
1365+
self.handle_action(action).await?;
1366+
self.render(terminal)?;
1367+
return Ok(());
1368+
}
1369+
13601370
// Check if autocomplete is visible and handle its navigation
13611371
if self.app_state.autocomplete.visible {
13621372
match key_event.code {

0 commit comments

Comments
 (0)