Xfce4 terminal: disable individual shortcut

terminalxfce

I would like to disable the Ctrl+Shift+W shortcut which closes the current terminal tab.

I am using Vim where Ctrl+R Ctrl+W moves between windows of the vim instance. Sometimes it may happen that the Shift key is pressed unintentionally while trying to move to the next window. However, this immediately closes the current terminal tab with the editor session.

Can I disable Ctrl+Shift+W in the terminal and leaving other shortcuts untouched?

Best Answer

This part from the XFCE FAQ:


  • If you are running the Xfce desktop environment, enable Editable menu accelerators in the User Interface Preferences dialog.
  • If you are running GNOME then you can enable Editable menu accelerators in the Menu and Toolbars control center dialog.
  • Otherwise put the following in your ~/.gtkrc-2.0 file (create the file if it doesn't exist):

    gtk-can-change-accels=1
    

When xfsettingsd is running you must change the setting with the Xfce GUI, not through the ~/.gtkrc-2.0 file.


Once that is done:

  • Open xfce4-terminal
  • Open a new tab (Ctrl+Shift+T) so you have two tabs open
  • Move your mouse up to File and click to open the menu
  • Move your mouse down to Close Tab Ctrl+Shift+W and do NOT click the mouse
  • Press the Backspace key on your keyboard

Shortcut gone!


The User Interface Preferences plugin may not be installed and thus editing the file

~/.config/xfce4/terminal/accels.scm

may become necessary. Adding the line

(gtk_accel_path "<Actions>/terminal-window/close-tab" "")

will have disabled the shortcut after the next start of the terminal.

Related Question