aboutsummaryrefslogtreecommitdiffstats
path: root/crates/turtle/src/shell/atuin.zsh (unfollow)
Commit message (Collapse)Author
3 dayschore(server): Simplify the database supportBenedikt Peetz
3 dayschore: Move everything into one big crateBenedikt Peetz
That helps remove duplicated code and rustc/cargo will now also show dead code correctly.
6 daysfeat: Capture command output + expose to new `atuin_output` tool (#3510)Michelle Tilley
2026-05-27fix: Atuin hangs when attempting to spawn daemon from Ctrl+R invocation (#3502)Michelle Tilley
This PR fixes a shell hang when daemon autostart happens from the interactive search widget. The bash/zsh/fish integrations run `atuin search -i` under command substitution and swap stdout/stderr so the TUI can draw to the terminal while the selected command is captured: ```sh 3>&1 1>&2 2>&3 ``` This leaves fd 3 open in the atuin search process. If search autostarts the daemon, the spawned long-running `atuin daemon start --daemonize` inherits fd 3, the command-substitution pipe, so the shell keeps waiting for EOF until the daemon is killed. The fix: close fd 3 after the swap in the non-tmux bash/zsh/fish paths: ```sh 3>&1 1>&2 2>&3 3>&- ``` Tested on zsh; I still need to confirm for bash and fish. Near as I can tell, the other shell integrations don't need this change. Fixes #3499
2026-02-24fix: forward $PATH to tmux popup in zsh (#3198)postmath
The functionality to run a tmux popup has the problem that the command runs as a child of the `tmux` *server* process, rather than the current shell. One potential issue is that the `$PATH` is not forwarded to this command, so the `atuin` command may not be found. Fixes: https://github.com/atuinsh/atuin/issues/3182 (#3182) <!-- Thank you for making a PR! Bug fixes are always welcome, but if you're adding a new feature or changing an existing one, we'd really appreciate if you open an issue, post on the forum, or drop in on Discord --> ## Checks - [x] I am happy for maintainers to push small adjustments to this PR, to speed up the review cycle - [x] I have checked that there are no existing pull requests for the same thing
2026-02-13fix: silent DB failures e.g. when disk is full (#3183)Johannes Naylor
<!-- Thank you for making a PR! Bug fixes are always welcome, but if you're adding a new feature or changing an existing one, we'd really appreciate if you open an issue, post on the forum, or drop in on Discord --> ## Checks - [x] I am happy for maintainers to push small adjustments to this PR, to speed up the review cycle - [x] I have checked that there are no existing pull requests for the same thing Silent DB failures breaking shell when disk is full When storage runs out (i.e. disk full), atuin breaks the shell by continuously printing database errors for every character typed. This is a fix to silence the DB errors
2026-02-11fix(shell): fix ATUIN_SESSION errors in tmux popup (#3170)Kkoi
This PR fixes: + #3154 + #3164 + #3166 It changes the following: + Pass ATUIN_SESSION to tmux popup + Use `command rm` to bypass user-defined configs + Disable tmux popup by default ## Checks - [x] I am happy for maintainers to push small adjustments to this PR, to speed up the review cycle - [x] I have checked that there are no existing pull requests for the same thing --------- Co-authored-by: Ellie Huxtable <ellie@elliehuxtable.com>
2026-01-28feat: add option to use tmux display-popup (#3058)Kkoi
This is a "continuation" of #1177 - which was a draft that used FIFOs (named pipes) to get output from the popup, however this causes popup not being closed properly, so in this PR I use tmpfile to store the result and read after popup closes. @ellie could you review this PR please? P.S. Thank you @immae for sharing your idea! ## Feature + Option to use tmux popup window in `config.toml` + Customize window width/height in `config.toml` + Tmux display-popup for `zsh, bash, fish` ## Checks - [x] I am happy for maintainers to push small adjustments to this PR, to speed up the review cycle - [x] I have checked that there are no existing pull requests for the same thing --------- Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-01-27fix: new session on shlvl change (#3111)Ellie Huxtable
eg, the user uses tmux, runs zsh again as a nested session, etc ## 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
2026-01-27fix: do not set ATUIN_SESSION if it is already set (#3107)Ellie Huxtable
<!-- Thank you for making a PR! Bug fixes are always welcome, but if you're adding a new feature or changing an existing one, we'd really appreciate if you open an issue, post on the forum, or drop in on Discord --> ## 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
2025-09-18refactor: shell environment variablesLucas Trzesniewski
2025-09-18fix: remove __atuin_chain_command__ prefixLucas Trzesniewski
The command chaining feature can be implemented without the prefix.
2025-07-22feat: command chaining (#2834)Ellie Huxtable
* feat: command chaining Allow for smart completion of commands ending in && or || * fmt
2025-06-05fix: Don't print errors in `zsh_autosuggest` helper (#2780)jyn
Previously, this would result in long multi-line errors when typing, making it hard to see the shell prompt: ``` $ Error: could not load client settings Caused by: 0: could not create config file 1: failed to create file `/home/jyn/.config/atuin/config.toml` 2: Required key not available (os error 126) Location: atuin-client/src/settings.rs:675:54 fError: could not load client settings Caused by: 0: could not create config file 1: failed to create file `/home/jyn/.config/atuin/config.toml` 2: Required key not available (os error 126) Location: atuin-client/src/settings.rs:675:54 faError: could not load client settings ``` Silence these in autosuggestions, such that they only show up when explicitly invoking atuin.
2025-04-28Revert "feat(zsh): try to go to the position in zsh's history (#1469)" (#2715)Ellie Huxtable
This reverts commit 264da9e4e964512f1e2e814c76010fd11d31b87a.
2025-04-04fix(zsh): avoid calling user-defined widgets when searching for history ↵依云
position (#2670) Or those widgets may behave badly when calling them too quickly. We don't need calling them anyway as this is not considered to be user action, and if our calls fail, the history position is unchanged. Issue introduced in #1469.
2025-04-01fix(zsh): fix an error introduced earilier with support for bracketed paste ↵依云
mode (#2651) An extra newline was written to the terminal and caused issues. See https://github.com/atuinsh/atuin/pull/2646#issuecomment-2757157442.
2025-03-25feat(zsh): re-enable bracketed paste (#2646)依云
* feat(zsh): re-enable bracketed paste atuin will reset it so after exiting atuin without executing a command, bracketed paste mode is disabled until a command is executed. This breaks e.g. the bracketed-paste-url-magic widget. This change will re-enable it if it's enabled; when it's disabled or unavailable, $zle_bracketed_paste[1] will be empty string. * silent shellcheck
2025-03-12feat(zsh): try to go to the position in zsh's history (#1469)依云
by using infer-next-history and then up-history. This is very helpful to execute consecutive commands with accept-line-and-down-history.
2024-04-18chore: move crates into crates/ dir (#1958)Ellie Huxtable
I'd like to tidy up the root a little, and it's nice to have all the rust crates in one place
2024-03-12fix: pass search query in via env (#1865)Ellie Huxtable
* fix: pass search query in via env * fix
2024-01-29feat(zsh): update widget names (#1631)Koichi Murase
The current widget names for Zsh start with "_", which gives an impression to users that those widgets are internal API and should not be bound by the users. However, we actually instruct users to set up custom keybindings by specifying them to bindkey. In other shells, a separate namespace for widgets are not prepared, so we want to prefix "_" to shell function names to tell the users that these are not the commands that are supposed to be called from the command line. However, the widget names are separated in their own namespace in Zsh, so we do not have to isolate them by prefixing "_". In fact, other frameworks such as `fzf` define widgets with names not starting with "_". In this patch, we update the widget names to have the form "atuin-*". The old widget names that existed in the release version <= 17.2.1 are left for compatibility.
2024-01-16feat(search): introduce keymap-dependent vim-mode (#1570)Koichi Murase
* feat(search): introduce keymap-dependent vim-mode * fix(zsh): provide widgets with specific keymaps * fix(settings): unify "vim" and "keymap_mode"
2024-01-10feat(bash): support high-resolution timing even without ble.sh (#1534)Koichi Murase
* feat(bash): support high-resolution timing without blesh For the integration using bash-preexec, this measures the execution time of the command using EPOCHREALTIME without the support by ble.sh. This is not as accurate as the measurement by ble.sh as it contains also the processing time of the preexec and precmd hooks, but it is still free from the fork cost. * fix(shell): work around custom IFS for duration When a custom IFS is set by the user, the word splitting of ${duration:+--duration "$duration"} does not work as expected. We instead use the form "--duration=$duration" with the word splitting being disabled.
2024-01-10refactor(shell): refactor and localize `HISTORY => __atuin_output` (#1535)Koichi Murase
2024-01-08fix(shell): fix incorrect timing of child shells (#1510)Koichi Murase
When a child shell session is started from another shell session (parent session), the environment variable ATUIN_HISTORY_ID set by the parent session causes Atuin's precmd hook of the child session to be unexpectedly performed before the first call of Atuin's preexec hook. In this patch, we clear ATUIN_HISTORY_ID (possibly set by the parent session) on the startup of the session.
2024-01-05fix: Prevent input to be interpreted as options for zsh autosuggestions (#1506)Mattias Eriksson
Co-authored-by: Mattias Eriksson <snaggen@mayam.com>
2024-01-02fix(zsh): zsh_autosuggest_strategy for no-unset environment (#1486)DS/Charlie
* fix for zsh no-unset environments * fix zsh_autosuggest_strategy for no-unset environment
2024-01-02feat(shell): support high-resolution duration if available (#1484)Koichi Murase
* feat(bash): measure duration in microsecond resolution with ble.sh * feat(zsh): measure duration in nanosecond resolution with zsh/datetime * refactor(history): use Option<i64> for command-line arg duration Co-authored-by: Ellie Huxtable <ellie@elliehuxtable.com> * style(history): apply suggestion by `cargo fmt` * fix(history): use Option<u64> for arg duration --------- Co-authored-by: Ellie Huxtable <ellie@elliehuxtable.com>
2024-01-02fix(bash,zsh): fix quirks on search cancel (#1483)Koichi Murase
* fix(bash): preserve the line content on search cancel In the current implementation for Bash, the line content is lost when the user cancels the atuin search by pressing ESC, C-g, or Down at the bottom line. This is because the line content is set to the empty string returned by atuin on the cancellation of the search. In the integrations for other shells, zsh and fish, the empty output is properly handled so that the line content is preserved. This patch makes the behavior in Bash consistent with that in zsh and fish, i.e., we do nothing when the atuin search returns an empty output. * fix(zsh): ignore confusing line `__atuin_accept__:*` on search cancel
2024-01-01feat: integrate with zsh-autosuggestions (#1479)Ellie Huxtable
* feat: integrate with zsh-autosuggestions * Update atuin/src/shell/atuin.zsh Co-authored-by: Patrick Jackson <patrick@jackson.dev> * Update atuin/src/shell/atuin.zsh Co-authored-by: Patrick Jackson <patrick@jackson.dev> * feedback --------- Co-authored-by: Patrick Jackson <patrick@jackson.dev>
2023-10-31fix(zsh): Only trigger up-arrow on first line (#1359)Patrick Jackson
* fix(zsh): Only trigger up-arrow on first line * fix(zsh): only trigger up-key if the buffer is 1 line
2023-10-20Add fish support for `enter_accept` (#1315)Ellie Huxtable
* Add fish support for `enter_accept` Also fixes shell detection. Who trusted me to write jetlagged code last night huh? * Document
2023-10-20Add enter_accept to immediately execute an accepted command (#1311)Ellie Huxtable
* make enter execute the command, tab copy it * Add config for enter_accept enter_accept will make Atuin immediately accept an execute a command when selected. It defaults to false in our binary, but the default config enables it. This means that users who already use atuin will not default to the new behaviour unless they opt in, but new users will have it by default. Thanks to @davidhewitt for the patch and bulk of this implementation! Currently we have it just for zsh, but I'll follow up with other shells (unless anyone beats me to it :D) * Add docs * we need to tidy up the ui code anyway * Check if using zsh * Update docs/docs/config/config.md Co-authored-by: Conrad Ludgate <conradludgate@gmail.com> --------- Co-authored-by: David Hewitt <1939362+davidhewitt@users.noreply.github.com> Co-authored-by: Conrad Ludgate <conradludgate@gmail.com>
2023-10-08clear history id (#1263)Conrad Ludgate
* clear history id * fix nu
2023-08-14Remove terminal mode switching (#1170)Ellie Huxtable
This was initially in place for when we used a different terminal backend. That backend required that the terminal be in a specific mode, or otherwise key modifiers would not be correctly recognized. It was super frustrating. Since the move to crossterm, we automatically switch to raw mode: https://github.com/atuinsh/atuin/blob/b48de9bd9d89fb9b6a0044a1b251e5b2ff116387/atuin/src/command/client/search/interactive.rs#L528 Should resolve #987, #650, #909, #492 Should also supercede #1149
2023-07-10fix for zsh no-unset environments (#921)DS/Charlie
2023-04-14Workspace reorder (#868)Vladislav Stepanov
* Try different workspace structure Move main crate (atuin) to be on the same level with other crates in this workspace * extract common dependencies to the workspace definition * fix base64 v0.21 deprecation warning * questionable: update deps & fix chrono deprecations possible panic sites are unchanged, they're just more visible now * Revert "questionable: update deps & fix chrono deprecations" This reverts commit 993e60f8dea81a1625a04285a617959ad09a0866.
2022-12-24Rework `atuin init` (#652)Jamie Quigley
* Rework `atuin init` This allows users to disable the CTRL-R and Up Arrow bindings, independently from one another * Document --disable-{ctrl-r,up-arrow} * Apply suggestions from code review Co-authored-by: Ellie Huxtable <ellie@elliehuxtable.com> Co-authored-by: Ellie Huxtable <ellie@elliehuxtable.com>
2022-12-18Allow overriding filter and search modes from CLI (#635)Patrick Decat
* Allow overriding filter and search modes from CLI arguments * Use session filter mode for bash up key binding * We precisely do not want to add quotes here so that all arguments are properly passed * Add --shell-up-key-binding hidden command argument and filter_mode_shell_up_key_binding configuration option to allow customizing the filter mode used when atuin is invoked from a shell up-key binding * Correct up binding for zsh Co-authored-by: Ellie Huxtable <ellie@elliehuxtable.com>
2022-09-25Clear RBUFFER when accepting output from atuin (#545)c-14
Since we pass $BUFFER to atuin search, retaining RBUFFER (the part of the buffer to the right of the cursor) probably doesn't make sense. The advantage of setting RBUFFER and LBUFFER separately instead of setting BUFFER is that the cursor is positioned after the end of LBUFFER instead of remaining where it was before atuin was called.
2022-08-23Fix atuin crashing on commands that start with -- (#509)Jamie Quigley
The use of `--` in the shell scripts prevents clap attempting to parse the command name as a flag, in the case that it starts with `--`.
2022-05-16Don't pollute shell environment - remove 'id' variable (#408)Jakub Jirutka
2021-05-14run shellcheck (#97)Ian Smith
* run shellcheck * Update .github/workflows/shellcheck.yml Co-authored-by: Conrad Ludgate <oon@conradludgate.com> * shellcheck fixes in which i am highly confident * shellcheck fixes in which I am less confident - not executing this is fine, right? * SC2155 In src/shell/atuin.bash line 1: export ATUIN_SESSION=$(atuin uuid) ^-----------^ SC2155: Declare and assign separately to avoid masking return values. * shellcheck doesn't support zsh, per https://github.com/koalaman/shellcheck/wiki/SC1071 * yaml fix * gotta checkout our code, too * yaml fix * action spelling * exclude .zsh * Shellcheck doesn't support zsh, per https://github.com/koalaman/shellcheck/wiki/SC1071, and the ignore: param in ludeeus/action-shellcheck only supports _directories_, not _files_. So instead, we manually add any error the shellcheck step finds in the file to the above line ... * comment all the ignores * Update src/shell/atuin.bash Co-authored-by: Ellie Huxtable <ellie@elliehuxtable.com> * new zsh plugin shellcheck errors * new zsh plugin shellcheck errors, pt 2 Co-authored-by: Conrad Ludgate <oon@conradludgate.com> Co-authored-by: Ellie Huxtable <ellie@elliehuxtable.com>
2021-05-08Add ATUIN_NOBIND (#62)Ellie Huxtable
* Add ATUIN_NOBIND * Update docs/key-binding.md `<kbd>`, what magic Co-authored-by: bl-ue <54780737+bl-ue@users.noreply.github.com> Co-authored-by: bl-ue <54780737+bl-ue@users.noreply.github.com>
2021-04-26Support bash, resolves #3Ellie Huxtable
2021-04-21Bugfixes, show time ago, perf improvementsEllie Huxtable
Also allow unique listing and more ergonomic cwd usage
2021-04-20Switch to Warp + SQLx, use async, switch to Rust stable (#36)Ellie Huxtable
* Switch to warp + sql, use async and stable rust * Update CI to use stable
2021-04-13Add history sync, resolves #13 (#31)Ellie Huxtable
* Add encryption * Add login and register command * Add count endpoint * Write initial sync push * Add single sync command Confirmed working for one client only * Automatically sync on a configurable frequency * Add key command, key arg to login * Only load session if it exists * Use sync and history timestamps for download * Bind other key code Seems like some systems have this code for up arrow? I'm not sure why, and it's not an easy one to google. * Simplify upload * Try and fix download sync loop * Change sync order to avoid uploading what we just downloaded * Multiline import fix * Fix time parsing * Fix importing history with no time * Add hostname to sync * Use hostname to filter sync * Fixes * Add binding * Stuff from yesterday * Set cursor modes * Make clippy happy * Bump version
2021-03-20Add TUI, resolve #19, #17, #16 (#21)Ellie Huxtable