Skip to content

Commit 7984f9e

Browse files
authored
feat(tui): configurable prefix character (#2157)
* feat(tui): configurable prefix character * string not char because toml/json lol
1 parent 4dd76d8 commit 7984f9e

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

crates/atuin-client/src/settings.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ pub struct Sync {
330330
#[derive(Clone, Debug, Deserialize, Default, Serialize)]
331331
pub struct Keys {
332332
pub scroll_exits: bool,
333+
pub prefix: String,
333334
}
334335

335336
#[derive(Clone, Debug, Deserialize, Serialize)]
@@ -715,6 +716,7 @@ impl Settings {
715716
.set_default("enter_accept", false)?
716717
.set_default("sync.records", false)?
717718
.set_default("keys.scroll_exits", true)?
719+
.set_default("keys.prefix", "a")?
718720
.set_default("keymap_mode", "emacs")?
719721
.set_default("keymap_mode_shell", "auto")?
720722
.set_default("keymap_cursor", HashMap::<String, String>::new())?

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ impl State {
204204
let esc_allow_exit = !(self.tab_index == 0 && self.keymap_mode == KeymapMode::VimInsert);
205205

206206
// support ctrl-a prefix, like screen or tmux
207-
if ctrl && input.code == KeyCode::Char('a') {
207+
if ctrl && input.code == KeyCode::Char(settings.keys.prefix.chars().next().unwrap_or('a')) {
208208
self.prefix = true;
209209
return InputAction::Continue;
210210
}

0 commit comments

Comments
 (0)