
(to avoid other applications started within that terminal to go through that wrapper).Īnd bind: bindkey -M emacs '^[[24 6~' backward-kill-word Run the script below as: that-script guakeĪnd add to your ~/.zshrc if then Incidentally, zsh makes it relatively easy as it has builtin Unix domain and TCP socket APIs. With X11 terminal emulators where Ctrl+Shift+Backspace sends the same thing as Backspace and that don't provide with any way to change it (and if you're desperate), as a dirty hack you could hijack the communication between the terminal emulator and the X server, and for instance replace Backspace (keycode 22) with F12 (keybode 96) in the X11 event message sent to the terminal emulator when Backspace is pressed while Shift and Ctrl are being held. Ctrl+letter doesn't send the corresponding control character). I'd normally recommend to enable modifyOtherKeys, which is mostly backwards compatible, but the particular key chord you want is only enabled at level 2, which is a pain to cope with (e.g. ¹ I chose this sequence to be compatible with xterm's modifyOtherKeys mode. They may be willing to add ad hoc support for a specific key though. They don't have any way to configure key bindings. With terminals based on vte, including Gnome-terminal, Guake and Terminator, you're out of luck. Then you can use this escape sequence¹: bindkey -M emacs '^[[27 6 8~' backward-kill-word Many environments load this when you log in if yours doesn't, add this command to your X11 startup file. Consult your terminal's documentation.įor example, for xterm, you can put the snippet below in your. Some terminals, such as xterm, rxvt, iTerm2 and Emacs term, allow you to configure escape sequences for each keychord manually. The only solution is to configure your terminal to send different escape sequences. Your terminal sends the same escape sequence for Ctrl+ Shift+ Backspace as for Ctrl+ Backspace, so there's no way for zsh to distinguish between the two.
