projects
/
selector.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0b90cd6
)
Added --hist-readline that works without tty injection
master
author
François Fleuret
<fleuret@meta.com>
Mon, 26 Jan 2026 16:20:45 +0000
(17:20 +0100)
committer
François Fleuret
<fleuret@meta.com>
Mon, 26 Jan 2026 16:20:45 +0000
(17:20 +0100)
bash-selector.sh
patch
|
blob
|
history
diff --git
a/bash-selector.sh
b/bash-selector.sh
index
63d3081
..
9416da5
100755
(executable)
--- a/
bash-selector.sh
+++ b/
bash-selector.sh
@@
-43,6
+43,12
@@
function selector-history () {
selector --bash -j -y -u -c 7,4,0,3 -q <(history)
}
selector --bash -j -y -u -c 7,4,0,3 -q <(history)
}
+function selector-history-readline () {
+ selector --bash -j -y -u -c 7,4,0,3 -q <(history) -o /tmp/selector-cmd
+ READLINE_LINE=$(echo /tmp/selector-cmd)
+ READLINE_POINT="${#READLINE_LINE}"
+}
+
######################################################################
# Selector-based directory history
######################################################################
######################################################################
# Selector-based directory history
######################################################################
@@
-119,6
+125,11
@@
if [[ "$1" ]]; then
bind '"\C-[r":"\C-a\C-k selector-history\C-m"'
;;
bind '"\C-[r":"\C-a\C-k selector-history\C-m"'
;;
+ --hist-readline)
+ # M-r puts the selected history line in place of the current one
+ bind '"\C-[r":"\C-a\C-k selector-history-readline\C-m"'
+ ;;
+
--cd)
# M-c provides a dynamic list of directories to cd into
bind '"\C-[c":"\C-a\C-k selector-cd-search\C-m"'
--cd)
# M-c provides a dynamic list of directories to cd into
bind '"\C-[c":"\C-a\C-k selector-cd-search\C-m"'