summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Jackson <patrick@jackson.dev>2022-11-19 13:05:25 -0800
committerGitHub <noreply@github.com>2022-11-19 21:05:25 +0000
commit478af1fa0f2f39814d04f95571c6c96841c3ee29 (patch)
tree52c3a3458630ceca3e849bd3baf6a31aa48d0a88
parentf3894ef9c0c9d2d9effa963b116d0075d4e7a9e5 (diff)
Handle multiline commands in fish shell (#623)
-rw-r--r--src/shell/atuin.fish15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/shell/atuin.fish b/src/shell/atuin.fish
index f675d638..69175ad4 100644
--- a/src/shell/atuin.fish
+++ b/src/shell/atuin.fish
@@ -23,10 +23,19 @@ function _atuin_search
end
function _atuin_bind_up
- if commandline -P
+ # Fallback to fish's builtin up-or-search if we're in search or paging mode
+ if commandline --search-mode; or commandline --paging-mode
up-or-search
- else
- _atuin_search
+ return
+ end
+
+ # Only invoke atuin if we're on the top line of the command
+ set -l lineno (commandline --line)
+ switch $lineno
+ case 1
+ _atuin_search
+ case '*'
+ up-or-search
end
end