feat(config): switch tv pickers to --inline and improve prompt redraw handling

This commit is contained in:
Prad Nukala committed 2026-09-30 11:54:14 -04:00
1 parent 19aeed21ac
commit a5bf3e9194
10 files changed
+173 -57

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
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