diff --git a/dot_local/bin/executable_atuin-pick b/dot_local/bin/executable_atuin-pick index 1602452..1708877 100755 --- a/dot_local/bin/executable_atuin-pick +++ b/dot_local/bin/executable_atuin-pick @@ -3,14 +3,14 @@ atuin search -i draws its TUI on the tty and prints the selected command to stdout (Esc prints nothing). Filter to history from the current -directory. Run the selection with rc loaded so aliases and functions -resolve — its output stays in this split — then drop to an interactive -shell. +directory. Hand the selection to an interactive fish via --init-command: +it runs inside that shell (aliases/abbr resolve, cd persists) with its +output in the split, and the prompt drops down below it. """ import os +import shlex import shutil import subprocess -import sys # kitty's launch env has neither ~/.atuin/bin on PATH nor ATUIN_SESSION # (atuin's shell init never ran), so resolve and seed both here. @@ -25,7 +25,8 @@ sel = subprocess.run( stdout=subprocess.PIPE, text=True, ).stdout.strip() + +argv = ["fish"] if sel: - print(f"\u276f {sel}", file=sys.stderr) - subprocess.run(["zsh", "-ic", "--", sel]) -os.execvp("zsh", ["zsh", "-i"]) + argv += ["-C", f"echo {shlex.quote('\u276f ' + sel)}; {sel}"] +os.execvp("fish", argv)