Hi I'd like to change the key mappings slightly in xfce4-terminal, maybe similar to adding Xterm.VT100.translations to .Xresources.
In particular, I want to make ctrl-backspace delete the last word, and ctrl-delete delete the next word.
Bonus: I'd like to make alt act like ctrl (duplicate functionality) for backspace, delete, left arrow, right arrow.
How to do all or any of these things in xfce4-terminal ?
EDIT: Progress so far: I'm using bash, and bash uses the the readline library and a bash built-in function, "bind," to map key sequences to readline functions. The functions I need turn out to be "shell-kill-word" and "shell-backward-kill-word." In principle, I should be able to do something like this:
"\C-Rubout":shell-backward-kill-word "\C-Delete":shell-kill-word "\M-Rubout":shell-backward-kill-word "\M-Delete":shell-kill-word
However, the xfce4-terminal emulator, or some component higher upstream in the process (could it be the window manager, xfwm4, the Xorg program itself?) is not cooperating. In general, the meta key is translated to an Escape character, for example this works:
"\ey":shell-kill-word <-- Meta + y kills next word
but with the the backspace and delete keys I'm out of luck. I tested the keycodes from two terminal emulators, xfce4-terminal and xterm, generated by backspace and delete and control-key combinations on my keyboard. Here they are, as reported by emacs's C-h C-l command:
xterm: backspace: DEL delete: \e[3~ \C-backspace: \C-h \C-delete: \e[3;5~ \M-backspace: y-umlaut (y with two dots over it) \M-delete: nothing xfce4-terminal: backspace: DEL delete: \e[3~ \C-backspace: DEL \C-delete: \e[3;5~ \M-backspace: \e DEL \M-delete: nothing
In particular, in xfce4-terminal it is impossible to bind \C-backspace to shell-backword-kill-word because it sends the exact same keycode as a regular backspace. And it's impossible to bind \M-delete to shell-kill-word because it doesn't send a keycode at all.
I'm frustrated because one (big) reason for switching to Linux and dealing with all the hardware/software compatibiltiy issues is that Linux is so customizable. I like having my windows get focus when I mouse over them for example, rather then click on them. Addressing problems like this one in modern Linux distros would seem to me to be a high priority task. Unfortunately I don't have time to do all the background research into X, and xfce I need to do to take the next step in solving this problem. Can someone with more knowledge of the Xorg ecosystem point me in the right direction? Perhaps there is an alternative terminal emulator that does this better?
Final piece of info: running emacs in an X window, it gets all but one of the keycodes:
backspace: <backspace> delete: <delete> \C-backspace: <C-backspace> \C-delete: <C-delete> \M-backspace: <M-backspace> \M-delete: nothing