aboutsummaryrefslogtreecommitdiffstats
path: root/atuin-client/src
diff options
context:
space:
mode:
authorSam Lanning <sam@samlanning.com>2022-11-06 07:34:14 +0000
committerGitHub <noreply@github.com>2022-11-06 07:34:14 +0000
commit4768b16b7409dd6ef8467037e46d60fd0c722d8c (patch)
tree0ff908c1c27f6cd0692c468c78be0b30e804a483 /atuin-client/src
parentfix #596: Avoid drawing a command section beyond the width of the list (#597) (diff)
downloadatuin-4768b16b7409dd6ef8467037e46d60fd0c722d8c.zip
Add setting for keeping typed query when exiting (#451)
* Add option for keeping typed query on escape fixes #422 * chore: Address duplicate if statement blocks
Diffstat (limited to 'atuin-client/src')
-rw-r--r--atuin-client/src/settings.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/atuin-client/src/settings.rs b/atuin-client/src/settings.rs
index 4462d992..574ee3fa 100644
--- a/atuin-client/src/settings.rs
+++ b/atuin-client/src/settings.rs
@@ -54,6 +54,15 @@ impl FilterMode {
}
}
+#[derive(Clone, Debug, Deserialize, Copy)]
+pub enum ExitMode {
+ #[serde(rename = "return-original")]
+ ReturnOriginal,
+
+ #[serde(rename = "return-query")]
+ ReturnQuery,
+}
+
// FIXME: Can use upstream Dialect enum if https://github.com/stevedonovan/chrono-english/pull/16 is merged
// FIXME: Above PR was merged, but dependency was changed to interim (fork of chrono-english) in the ... interim
#[derive(Clone, Debug, Deserialize, Copy)]
@@ -99,6 +108,7 @@ pub struct Settings {
pub session_path: String,
pub search_mode: SearchMode,
pub filter_mode: FilterMode,
+ pub exit_mode: ExitMode,
// This is automatically loaded when settings is created. Do not set in
// config! Keep secrets and settings apart.
pub session_token: String,
@@ -278,6 +288,7 @@ impl Settings {
.set_default("sync_address", "https://api.atuin.sh")?
.set_default("search_mode", "fuzzy")?
.set_default("filter_mode", "global")?
+ .set_default("exit_mode", "return-original")?
.set_default("session_token", "")?
.set_default("style", "auto")?
.add_source(