aboutsummaryrefslogtreecommitdiffstats
path: root/crates/atuin-client
diff options
context:
space:
mode:
authorEllie Huxtable <ellie@atuin.sh>2026-04-10 02:13:55 +0100
committerGitHub <noreply@github.com>2026-04-10 02:13:55 +0100
commit75190f58827026b5f5902b24815a8950e7333bac (patch)
treea919763f3974e6ffa617d3f9c8fc91504df099e9 /crates/atuin-client
parentdocs: Minor readability improvement to README (#3381) (diff)
downloadatuin-75190f58827026b5f5902b24815a8950e7333bac.zip
feat: add strip_trailing_whitespace, on by default (#3390)
I can't think of any reason you would want this disabled by default - trailing whitespace means nothing, breaks dedupe, and wastes a few bytes closes #3387 ## Checks - [ ] I am happy for maintainers to push small adjustments to this PR, to speed up the review cycle - [ ] I have checked that there are no existing pull requests for the same thing
Diffstat (limited to 'crates/atuin-client')
-rw-r--r--crates/atuin-client/config.toml5
-rw-r--r--crates/atuin-client/src/settings.rs2
2 files changed, 7 insertions, 0 deletions
diff --git a/crates/atuin-client/config.toml b/crates/atuin-client/config.toml
index 6e67a4e1..0d0672bf 100644
--- a/crates/atuin-client/config.toml
+++ b/crates/atuin-client/config.toml
@@ -113,6 +113,11 @@
## default history list format - can also be specified with the --format arg
# history_format = "{time}\t{command}\t{duration}"
+## Defaults to true. If enabled, strip trailing spaces and tabs from commands
+## before saving them to history.
+## Escaped trailing spaces (for example `printf foo\\ `) are preserved.
+# strip_trailing_whitespace = true
+
## prevent commands matching any of these regexes from being written to history.
## Note that these regular expressions are unanchored, i.e. if they don't start
## with ^ or end with $, they'll match anywhere in the command.
diff --git a/crates/atuin-client/src/settings.rs b/crates/atuin-client/src/settings.rs
index 22b892d1..e2624136 100644
--- a/crates/atuin-client/src/settings.rs
+++ b/crates/atuin-client/src/settings.rs
@@ -1092,6 +1092,7 @@ pub struct Settings {
pub word_chars: String,
pub scroll_context_lines: usize,
pub history_format: String,
+ pub strip_trailing_whitespace: bool,
pub prefers_reduced_motion: bool,
pub store_failed: bool,
pub no_mouse: bool,
@@ -1497,6 +1498,7 @@ impl Settings {
.set_default("workspaces", false)?
.set_default("ctrl_n_shortcuts", false)?
.set_default("secrets_filter", true)?
+ .set_default("strip_trailing_whitespace", true)?
.set_default("network_connect_timeout", 5)?
.set_default("network_timeout", 30)?
.set_default("local_timeout", 2.0)?