From 1ce88c9d17c6dd66d387b2dfd2544a527a262f3e Mon Sep 17 00:00:00 2001 From: Patrick Jackson Date: Sat, 2 Dec 2023 03:14:56 -0800 Subject: [PATCH] fix(fish): accept multiline commands (#1418) --- atuin/src/shell/atuin.fish | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/atuin/src/shell/atuin.fish b/atuin/src/shell/atuin.fish index bff37443..eeb7d92b 100644 --- a/atuin/src/shell/atuin.fish +++ b/atuin/src/shell/atuin.fish @@ -18,11 +18,11 @@ function _atuin_postexec --on-event fish_postexec end 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 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 -f repaint commandline -f execute