Fix atuin-pick: resolve atuin outside kitty PATH, rename to atuin-pick

This commit is contained in:
Prad Nukala committed 2026-08-14 13:58:17 -04:00
1 parent 0b28d234ac
commit b2d81c31d2
2 files changed
+9 -5

No files matched your search

+1 -1
View File
@@ -46,7 +46,7 @@ map ctrl+shift+g launch_ov lazygit
map ctrl+shift+f toggle_layout stack map ctrl+shift+f toggle_layout stack
map ctrl+shift+e launch_tb nvim map ctrl+shift+e launch_tb nvim
map ctrl+shift+a launch_vs omp map ctrl+shift+a launch_vs omp
map ctrl+shift+p launch_hs atuin-pick.py map ctrl+shift+p launch_hs atuin-pick
# Misc # Misc
map ctrl+shift+c copy_to_clipboard map ctrl+shift+c copy_to_clipboard
@@ -4,20 +4,24 @@
atuin search -i draws its TUI on the tty and prints the selected command 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 to stdout (Esc prints nothing). Filter to history from the current
directory. Run the selection with rc loaded so aliases and functions directory. Run the selection with rc loaded so aliases and functions
resolve, then drop to an interactive shell. resolve — its output stays in this split — then drop to an interactive
shell.
""" """
import os import os
import shutil
import subprocess import subprocess
import sys import sys
# kitty launches this outside a shell, so atuin's init never ran. # 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.
atuin = shutil.which("atuin") or os.path.expanduser("~/.atuin/bin/atuin")
if "ATUIN_SESSION" not in os.environ: if "ATUIN_SESSION" not in os.environ:
os.environ["ATUIN_SESSION"] = subprocess.run( os.environ["ATUIN_SESSION"] = subprocess.run(
["atuin", "uuid"], stdout=subprocess.PIPE, text=True [atuin, "uuid"], stdout=subprocess.PIPE, text=True
).stdout.strip() ).stdout.strip()
sel = subprocess.run( sel = subprocess.run(
["atuin", "search", "-i", "--filter-mode", "directory"], [atuin, "search", "-i", "--filter-mode", "directory"],
stdout=subprocess.PIPE, stdout=subprocess.PIPE,
text=True, text=True,
).stdout.strip() ).stdout.strip()