A continuación se muestra mi .inputrc
archivo. ¿Por qué, después de llamar bind ~/.inputrc
, mi tecla de barra diagonal hacia arriba está deshabilitada hasta que cierre sesión y vuelva a iniciar sesión?
# Key-bindings for the command-line editor.
# Ask before displaying >50 items
# Since $WINDIR $PATH var can be in $PATH, this could list
# all window exectables in C:\WINDOWS
set completion-query-items 50
# Ignore case for the command-line-completion functionality
# on: default to a Windows style console
# off: default to a *nix style console
set completion-ignore-case on
# none, visible or audible
set bell-style audible
# disable/enable 8bit input
set meta-flag on
set input-meta on
set output-meta off
set convert-meta on
# visible-stats
# Append a mark according to the file type in a listing
set visible-stats off
set mark-directories on
# Show all instead of beeping first
set show-all-if-ambiguous on
"\e[1~": beginning-of-line #HOME
"\e[4~": end-of-line #END
"\e[A":history-search-backward #UP
"\e[B":history-search-forward #DOWN
Respuesta1
Porque bind ~/.inputrc
es un comando para vincular la secuencia de claves /home/aliteralmind/inputrc
donde /home/aliteralmind
está su directorio de inicio. Esto se vincula /
a una clave de prefijo para la cual no se define ningún vínculo, por lo que presionar la /
tecla después no hace nada.
Para leer un archivo readline desde bash, use
bind -f ~/.inputrc
Sin embargo, este ejemplo en particular no es muy útil, ya que ~/.inputrc
se lee cuando se inicia bash. El único uso es cargar sus nuevos enlaces si cambia el archivo (esto no eliminará los enlaces que ha eliminado).