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.
This commit is contained in:
Patrick Jackson 2023-10-27 01:45:36 -06:00 committed by GitHub
parent 4096bb8d17
commit a57baffa91
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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