On 30/12/2023 09:14, Mike McClain wrote:
Since some of these use a
spinoff of xterm [ -n $DISPLAY ] is a little more generic than
[ $TERM == xterm ], RaspberryPI has chosen lxterminal as their default
which would would fail that test but still runs bash.
I would expect that the reason of failure is
echo $TERM
xterm-256color
so in bash the test should be e.g. [[ "$TERM" == xterm* ]]. The issue
with $DISPLAY test is that you may start screen or tmux in xterm or
lxterminal. I am unsure if keys generate the same escape sequences for
these terminal types.
Conditions in inputrc files are a bit more intelligent in respect to
terminal types, see readline(3):
Conditional Constructs
term
The term= form may be used to include terminal-specific key bindings,
perhaps to bind the key sequences output by the terminal's function
keys. The word on the right side of the = is tested against the full
name of the terminal and the portion of the terminal name before the
first -. This allows sun to match both sun and sun-cmd, for instance.
P.S. I have not managed to reproduce the single quote issue
bind -f /tmp/input-binding
cat /tmp/input-binding
'"\M-[1;5H": backward-kill-line'
bind -p | grep backward-kill-line
"\C-x\C-?": backward-kill-line
If I strip single quotes then another binding is added successfully.