Saturday, April 27, 2024
18
rated 0 times [  18] [ 0]  / answers: 1 / hits: 3382  / 2 Years ago, mon, april 18, 2022, 4:55:14

I usually use CTRL+Left and CTRL+Right to navigate between words on the command-line. I switched my laptop on this morning and can no longer do that. Instead, the CTRL+Left input code gets printed in the terminal.



Ie: Here's my output when I try to navigate with CTRL+Left:



~ $ test test ;5D;5D;5D


Curiously, I can still use CTRL+Left/Right just fine in VIM.


More From » command-line

 Answers
1

Open ~/.inputrc file and add the following lines:



# mappings for Ctrl-left-arrow and Ctrl-right-arrow for word moving
"e[1;5C": forward-word
"e[1;5D": backward-word


Close and reopen shell.Now you should be able to use those keys.



Reasons for this behavior ? Not quite certain. For some reason or the other your bash stopped reading /etc/inputrc file, but it should be reading the one in your home folder


[#16268] Wednesday, April 20, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
enincroscope

Total Points: 252
Total Questions: 124
Total Answers: 104

Location: Tajikistan
Member since Thu, Apr 14, 2022
2 Years ago
;