Files
dotfiles/dot_config/fish/functions/_pj_bind.fish
T
Prad Nukala 2049f580f0 revert(shell): move iris integration to the iris branch
Reverts 43dfe48, 0692ae3, e0cdcd6 and the cable-description half of
098da70 (the star-prompt stats stay). master returns to the pre-iris
shell setup: atuin in fish/zsh/bash, the down -> pj binding with
PJ_QUIET, and the fish/zsh key bindings as they were. The iris work
lives on the `iris` branch.
2026-10-05 10:41:51 -04:00

22 lines
774 B
Fish

function _pj_bind --description 'ctrl-p / down: pj (tv --inline), then redraw the prompt in the right place'
# pj reports through $PJ_STATE: `open` = the picker was cancelled and
# left the cursor on the line below the prompt; empty = no task sources,
# nothing drawn — but fish's repaint after an external command still
# lands one line low, so both step back up. `ran` = a task printed
# output: new line, prompt below it.
set -lx PJ_STATE (mktemp)
if contains -- --quiet $argv
set -lx PJ_QUIET 1
end
pj
set -l state (cat $PJ_STATE)
switch "$state"
case open ''
printf '\033[A' >/dev/tty
case ran
printf '\n' >/dev/tty
end
rm -f $PJ_STATE
commandline -f repaint
end