Skip to content

Commit e45979c

Browse files
authored
fix(tui): Press ctrl-a twice should jump to beginning of line (#2246)
1 parent 6d254c6 commit e45979c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

crates/atuin/src/command/client/search/interactive.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,10 @@ impl State {
206206
let esc_allow_exit = !(self.tab_index == 0 && self.keymap_mode == KeymapMode::VimInsert);
207207

208208
// support ctrl-a prefix, like screen or tmux
209-
if ctrl && input.code == KeyCode::Char(settings.keys.prefix.chars().next().unwrap_or('a')) {
209+
if !self.prefix
210+
&& ctrl
211+
&& input.code == KeyCode::Char(settings.keys.prefix.chars().next().unwrap_or('a'))
212+
{
210213
self.prefix = true;
211214
return InputAction::Continue;
212215
}
@@ -301,6 +304,8 @@ impl State {
301304
}
302305
KeyCode::Char('a') => {
303306
self.search.input.start();
307+
// This prevents pressing ctrl-a twice while still in prefix mode
308+
self.prefix = false;
304309
return InputAction::Continue;
305310
}
306311
_ => {}

0 commit comments

Comments
 (0)