How to disable Navigation Keys in Bash Shell?

0

I've did a serious research on Google Web and Stack Exchange websites prior asking the question, and come across to keywords and got acquainted with their meanings such as bind, bind -r, read, /etc/inputrc, ~/.inputrc \e, [A, [B, [C, [D, and GNU Readline what I didn't know about before.

I tried to disable myself but could do that only to partial effect.

What I really want is to completely disable Text Navigational Keys alongside Page Navigational Keys in Bash, and possibly in all consoles.

I do it because I want to enforce the Vim key bindings everywhere possible, and had already set set -o vim to benefit from Vim modes presence in Bash.

I think the most correct way would be achieving so through ~\.inputrc, tried, failed.

user373230

Posted 2016-11-10T13:59:25.610

Reputation:

1

See this on Stackexchange Unix.

– Ilker Mutlu – 2016-11-10T14:17:26.660

1Thanks, it really worked, it seems :"" that part must follow the key codes inside the file to unmap them. I could map [H, [F, [5~, [6~ disabling the page navigation keys as well. – None – 2016-11-10T20:28:01.507

Answers

1

Since the link I provided worked, we can post it as an answer.

Adding the following to .inputrc will map the arrow keys to nothing.

$if mode=vi
"\eOD":""
"\e[D":""
"\eOC":""
"\e[C":""
"\eOA":""
"\e[A":""
"\eOB":""
"\e[B":""
$endif

Source: This Stack Exchange Unix Post.

Ilker Mutlu

Posted 2016-11-10T13:59:25.610

Reputation: 138