0

I have been trying to rebind the shortcut for moving the cursor forwards/backwards one word at a time in the Xfce4 terminal.

I'm used to using <Ctrl>LeftArrow and <Ctrl>RightArrow to achieve this. Using these shortcuts in the terminal produces the following characters instead:

;5D when pressing <Ctrl>LeftArrow and ;5C when pressing <Ctrl>RightArrow

Using <Alt>B and <Alt>C does move the cursor one word at a time, but I'm not comfortable using this combination.

I've looked at '~/.config/xfce4/terminal/accels.scm' but there are no lines that correspond to the <Alt>B and <Alt>C shortcuts.

Is there a way to bind this functionality to <Ctrl>LeftArrow and <Ctrl>RightArrow?

2
  • You are conflating a terminal emulator with a shell, and asking about completely the wrong things. You need to tell people, in the question, what the shell is whose behaviour you are trying to change. Or if you are trying to use less, which is a different kettle of fish. unix.stackexchange.com/a/506578/5132 Or VIM. What the application program is, that is reading the input and moving the cursor using terminal I/O, is important.
    – JdeBP
    Commented Jan 30, 2020 at 13:23
  • @JdeBP - The shell I'm using is bash. The terminal emulator is Xfce4-terminal. I'm unsure which of the two is responsible for handling this particular shortcut. I'm not trying to change the cursor behaviour within less or my text editor, but rather when typing in a command. E.g. After typing into my terminal echo "Just Some Words.", if I wanted to change the word 'Just' before executing the command, I'd have to hold down <Alt> and hit B three times to make the cursor jump to the beginning of 'Just'. This is the shortcut I want to remap.
    – jahtzee
    Commented Jan 30, 2020 at 14:18

1 Answer 1

0

Adding the following lines to ~/.inputrc and re-reading the file works as a solution:

"\e[1;5C": forward-word
"\e[1;5D": backward-word

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .