diff options
| author | Patrick Jackson <patrick@jackson.dev> | 2023-10-27 01:45:36 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-10-27 08:45:36 +0100 |
| commit | a57baffa91e173098e7ad541dc2d56510a689a3e (patch) | |
| tree | 292b47858e57c3b642824de117a478fe2a96bb9c | |
| parent | update support template (#1340) (diff) | |
| download | atuin-a57baffa91e173098e7ad541dc2d56510a689a3e.zip | |
fix(fish): improve output for `enter_accept` (#1341)
Fixes 2 issues with the fish shell prompt when using `enter_accept`
1. Runs pre/post exec so the command is added to the atuin history.
2. Adds padding so that the repainting of the shell prompt doesn't overwrite the output.
This adds 2 lines of padding to account for prompts up to 2 lines tall, larger prompts will still cause repainting problems and smaller prompts will be getting an extra line.
| -rw-r--r-- | atuin/src/shell/atuin.fish | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/atuin/src/shell/atuin.fish b/atuin/src/shell/atuin.fish index 061ea8d1..9f02579e 100644 --- a/atuin/src/shell/atuin.fish +++ b/atuin/src/shell/atuin.fish @@ -24,7 +24,13 @@ function _atuin_search if string match -qg '__atuin_accept__:*' "$h" set hist (string match -r '__atuin_accept__:(.*|\s*)' "$h" | awk 'NR == 2') echo $hist + # Need to run the pre/post exec functions manually + _atuin_preexec $hist eval $hist + _atuin_postexec + # Allow space for repainting the prompt, this will work for prompts up to 2 lines + echo + echo else commandline -r "$h" end |
