| Commit message (Collapse) | Author |
|
|
|
That helps remove duplicated code and rustc/cargo will now also show
dead code correctly.
|
|
|
|
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
|
|
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
|
|
<!-- 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
|
|
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>
|
|
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>
|
|
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
|
|
<!-- 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
|
|
|
|
The command chaining feature can be implemented without the prefix.
|
|
* feat: command chaining
Allow for smart completion of commands ending in && or ||
* fmt
|
|
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.
|
|
This reverts commit 264da9e4e964512f1e2e814c76010fd11d31b87a.
|
|
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.
|
|
mode (#2651)
An extra newline was written to the terminal and caused issues. See https://github.com/atuinsh/atuin/pull/2646#issuecomment-2757157442.
|
|
* 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
|
|
by using infer-next-history and then up-history.
This is very helpful to execute consecutive commands with
accept-line-and-down-history.
|
|
I'd like to tidy up the root a little, and it's nice to have all the
rust crates in one place
|
|
* fix: pass search query in via env
* fix
|
|
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.
|
|
* feat(search): introduce keymap-dependent vim-mode
* fix(zsh): provide widgets with specific keymaps
* fix(settings): unify "vim" and "keymap_mode"
|
|
* 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.
|
|
|
|
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.
|
|
Co-authored-by: Mattias Eriksson <snaggen@mayam.com>
|
|
* fix for zsh no-unset environments
* fix zsh_autosuggest_strategy for no-unset environment
|
|
* 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>
|
|
* 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
|
|
* 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>
|
|
* fix(zsh): Only trigger up-arrow on first line
* fix(zsh): only trigger up-key if the buffer is 1 line
|
|
* Add fish support for `enter_accept`
Also fixes shell detection. Who trusted me to write jetlagged code last
night huh?
* Document
|
|
* 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>
|
|
* clear history id
* fix nu
|
|
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
|
|
|
|
* 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.
|
|
* 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>
|
|
* 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>
|
|
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.
|
|
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 `--`.
|
|
|
|
* 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>
|
|
* 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>
|
|
|
|
Also allow unique listing and more ergonomic cwd usage
|
|
* Switch to warp + sql, use async and stable rust
* Update CI to use stable
|
|
* 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
|
|
|