[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-bash] Whether line editing disabled, to prevent "bash: bind: warni
From: |
R. Diez |
Subject: |
[Help-bash] Whether line editing disabled, to prevent "bash: bind: warning: line editing not enabled" |
Date: |
Mon, 16 Jul 2018 10:03:42 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 |
Hi there:
I recently switched from configuring Readline in .inputrc to "bind"
commands in a file included from .bashrc . I find it more convenient,
because I can check in a single Bash configuration script into my
personal Git repository and use it in all my computers. Upgrading or
diff'ing it is faster. My personal config file is here:
https://github.com/rdiez/Tools/blob/master/Bash/bashrc-rdiez.sh
However, after the switch, I am getting this warning:
bash: bind: warning: line editing not enabled
This happens only in Emacs 'shell' windows, and not on Emacs 'term'
windows or on other terminal emulators.
I saw that Bash turns line editing off when it sees an EMACS environment
variable. That variable is not present on my setup, and other people
report the same:
https://stackoverflow.com/questions/41046558/bashrc-how-to-check-in-what-terminal-the-shell-is-running
On a 'shell' Emacs window, this is what I get:
declare -x INSIDE_EMACS="26.1,comint"
declare -x TERM="dumb"
declare -x TERMCAP=""
On a 'term' Emacs window:
declare -x INSIDE_EMACS="26.1,term:0.96"
declare -x TERM="eterm-color"
declare -x
TERMCAP="eterm-color:li#62:co#206:cl=\\E[H\\E[J:cd=\\E[J:bs:am:xn:cm=\\E[%i%d;%dH:nd=\\E[C:up=\\E[A:ce=\\E[K:ho=\\E[H:pt:al=\\E[L:dl=\\E[M:DL=\\E[%dM:AL=\\E[%dL:cs=\\E[%i%d;%dr:sf=^J:dc=\\E[P:DC=
\\E[%dP:IC=\\E[%d@:im=\\E[4h:ei=\\E[4l:mi::so=\\E[7m:se=\\E[m:us=\\E[4m:ue=\\E[m:md=\\E[1m:mr=\\E[7m:me=\\E[m:UP=\\E[%dA:DO=\\E[%dB:LE=\\E[%dD:RI=\\E[%dC:kl=\\EOD:kd=\\EOB:kr=\\EOC:ku=\\EOA:kN=\\E[6~:kP=\\E
[5~:@7=\\E[4~:kh=\\E[1~:mk=\\E[8m:cb=\\E[1K:op=\\E[39;49m:Co#8:pa#64:AB=\\E[4%dm:AF=\\E[3%dm:cr=^M:bl=^G:do=^J:le=^H:ta=^I:se=\\E[27m:ue=\\E[24m:kb=^?:kD=^[[3~:sc=\\E7:rc=\\E8:r1=\\Ec:"
declare -x TERMINFO="/home/rdiez/emacs-26.1-bin/share/emacs/26.1/etc/"
In both cases, Bash is interactive, which means that [ -t 1 ] returns true.
I am guessing that Bash turns off line editing based on the TERM
variable, but that is not documented (as far as I can see).
Is there a way to find out whether line editing is disabled, so that my
script should skip all the 'bind' commands for Readline?
Thanks in advance,
rdiez
- [Help-bash] Whether line editing disabled, to prevent "bash: bind: warning: line editing not enabled",
R. Diez <=