13

I am using Ubuntu 21.10.

When I am in vscode and I press Ctrl+Shift+e, the mapping does not get dispatched to vscode, and instead it types an underlined 'e' characters.

I have looked at lots of posts that indicate this is because of ibus, but I have since completely uninstalled ibus from my system, but still the problem persists.

I really need Ctrl+Shift+e mapping for vscode, and I am not willing to change that requirment. Is there anything I can do?

Serg
  • 824
  • 7
  • 14
Scorb
  • 770

5 Answers5

4

Ctrl+Shift+e may be assigned to the "Emoji annotation" function of ibus. It allows to enter emoji characters.

To disable or change that keybinding, open the terminal and launch the ibus setup tool with the command ibus-setup. On the "Emoji" tab, disable (or change) the shortcut next to "Emoji annotation".

If you are using Gnome Desktop, i.e., the default Ubuntu desktop, you may also need to clear the dconf setting. Choose one of following options:

  • To reset to the default keybinding (Ctrl+. and Ctrl+;)
    gsettings reset org.freedesktop.ibus.panel.emoji hotkey
    
  • To clear the keybindings:
    gsettings set org.freedesktop.ibus.panel.emoji hotkey "['']"
    
  • To set the keybinding to something else, e.g. only Ctrl+.:
    gsettings set org.freedesktop.ibus.panel.emoji hotkey "['<Control>period']"
    
vanadium
  • 88,010
1

My activity bar is hidden, I think VS Code believes the Explorer view is disabled. This worked for me, i removed the "when enabled" condition.

keybindings.json

    { "key": "ctrl+shift+e", "command": "workbench.view.explorer" },
    { "key": "ctrl+shift+x", "command": "workbench.view.extensions" },
    { "key": "ctrl+shift+d", "command": "workbench.view.debug" }

Note that Search and Repository views works fine because thy use a different "when"

icetbr
  • 111
0

It has been widely reported that keyboard shortcuts have issues with VSCode in Ubuntu/Linux (see below).

My suggestion #1 is that you check if the keybindings are correct, as per your intentions. This is what I get in Win 10 (I don't have VSCode in Ubuntu to check), with File -> Preferences -> Keyboard Shortcuts -> Search bar -> ctrl + shift + e

enter image description here

Right-clicking on each item and Copy gives

{
  "key": "ctrl+shift+e",
  "command": "workbench.view.explorer",
  "when": "viewContainer.workbench.view.explorer.enabled"
}

{ "key": "ctrl+shift+e", "command": "workbench.action.quickOpenNavigatePreviousInFilePicker", "when": "inFilesPicker && inQuickOpen" }

Please confirm by editing the OP:

  1. If you see the same in Win 10, and in Ubuntu, and if they match what you mean to have. For instance, this answer showed that the problem observed actually stemmed from shortcuts which had different definitions from what was intended. See also this, this. Note that this will, at the same time, help checking if the shortcuts are received by VSCode.
  2. What is the specific behaviour you mean to get with Ctrl+Shift+e.

I will wait for this further info.


Some problems reported with VSCode keyboard shortcuts in Ubuntu/Linux

  1. https://github.com/microsoft/vscode/issues/91866 (Ctrl+Shift+e)
  2. https://github.com/microsoft/vscode/issues/6197
  3. https://stackoverflow.com/questions/33636531/some-vscode-keybindings-not-working-in-ubuntu
  4. VS Code keyboard shortcut not working
  5. https://github.com/Microsoft/vscode/wiki/Keybinding-Issues#troubleshoot-linux-keybindings

Related

  1. https://code.visualstudio.com/docs/getstarted/keybindings
  • I see in Ubuntu 20.04 LTS, exactly the same keystroke mappings in the screenshot posted by sancho.s ReinstateMonicaCellio Because it matches and VS code is cross-platform and functions the same, you should vote for this answer. – mondotofu Apr 23 '22 at 01:09
0

posts that indicate this is because of ibus, but I have since completely uninstalled ibus from my system

Yeah, too bad Gnome decided it should also meddle with the already convoluted enough input stack. So you disable Ibus, but GTK decides to mimic it.

The solution is simple, though: Override the GTK_IM_MODULE variable to use the Xim input method (note: this links to my own content in a site that I moderate) when launching Vscod{e,ium}.

Quasímodo
  • 2,017
0

Removing the shortcuts (via dconf-editor or ibus-setup) did not work for me.

Setting input-method generally to xim gave me long-lasting inexplicable trouble (in Ubuntu 16, 20, 22...), in particular odd flickering menus in libre office. (I do not entirely grasp the rational reason myself...)

That being said, as VS code seems not to have that problem, @quasímodo's advice worked for me: Just starting code with the respective env variable:

GTK_IM_MODULE=xim code
  1. must be the first instance started (not another already “hanging around”
  2. you may actually kind of verify, you are on the right track: Go to keyboard settings, find Show Explorer, click key-binding to re-define the very same shortcut. If you get previewed ctrl-shift-undefined, you are on the wrong track... (press esc to not actually redefine then)

enter image description here

Frank N
  • 1,340