aboutsummaryrefslogtreecommitdiffstats
path: root/atuin-client
diff options
context:
space:
mode:
Diffstat (limited to 'atuin-client')
-rw-r--r--atuin-client/config.toml4
-rw-r--r--atuin-client/src/settings.rs8
2 files changed, 12 insertions, 0 deletions
diff --git a/atuin-client/config.toml b/atuin-client/config.toml
index d1c1081f..19e8e302 100644
--- a/atuin-client/config.toml
+++ b/atuin-client/config.toml
@@ -123,3 +123,7 @@
## 4. Slack webhooks
## 5. Stripe live/test keys
# secrets_filter = true
+
+## Defaults to true. If enabled, upon hitting enter Atuin will immediately execute the command. Press tab to return to the shell and edit.
+# This applies for new installs. Old installs will keep the old behaviour unless configured otherwise.
+enter_accept = true
diff --git a/atuin-client/src/settings.rs b/atuin-client/src/settings.rs
index 15aa9e06..fca76004 100644
--- a/atuin-client/src/settings.rs
+++ b/atuin-client/src/settings.rs
@@ -179,6 +179,7 @@ pub struct Settings {
pub network_connect_timeout: u64,
pub network_timeout: u64,
+ pub enter_accept: bool,
// This is automatically loaded when settings is created. Do not set in
// config! Keep secrets and settings apart.
@@ -378,6 +379,12 @@ impl Settings {
.set_default("secrets_filter", true)?
.set_default("network_connect_timeout", 5)?
.set_default("network_timeout", 30)?
+ // enter_accept defaults to false here, but true in the default config file. The dissonance is
+ // intentional!
+ // Existing users will get the default "False", so we don't mess with any potential
+ // muscle memory.
+ // New users will get the new default, that is more similar to what they are used to.
+ .set_default("enter_accept", false)?
.add_source(
Environment::with_prefix("atuin")
.prefix_separator("_")
@@ -391,6 +398,7 @@ impl Settings {
create_dir_all(&config_dir)
.wrap_err_with(|| format!("could not create dir {config_dir:?}"))?;
+
create_dir_all(&data_dir).wrap_err_with(|| format!("could not create dir {data_dir:?}"))?;
let mut config_file = if let Ok(p) = std::env::var("ATUIN_CONFIG_DIR") {