fix(fish): accept multiline commands (#1418)

This commit is contained in:
Patrick Jackson 2023-12-02 03:14:56 -08:00 committed by GitHub
parent 1c3d6c6ce8
commit 1ce88c9d17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,11 +18,11 @@ function _atuin_postexec --on-event fish_postexec
end end
function _atuin_search function _atuin_search
set -l ATUIN_H (ATUIN_SHELL_FISH=t ATUIN_LOG=error atuin search $argv -i -- (commandline -b) 3>&1 1>&2 2>&3) set -l ATUIN_H "$(ATUIN_SHELL_FISH=t ATUIN_LOG=error atuin search $argv -i -- (commandline -b) 3>&1 1>&2 2>&3)"
if test -n "$ATUIN_H" if test -n "$ATUIN_H"
if string match --quiet '__atuin_accept__:*' "$ATUIN_H" if string match --quiet '__atuin_accept__:*' "$ATUIN_H"
set -l ATUIN_HIST (string match --regex '__atuin_accept__:(.*|\s*)' "$ATUIN_H" | awk 'NR == 2') set -l ATUIN_HIST "$(string replace "__atuin_accept__:" "" -- "$ATUIN_H")"
commandline -r "$ATUIN_HIST" commandline -r "$ATUIN_HIST"
commandline -f repaint commandline -f repaint
commandline -f execute commandline -f execute