BetterThanTomorrow / calva

Clojure & ClojureScript Interactive Programming for VS Code
https://marketplace.visualstudio.com/items?itemName=betterthantomorrow.calva
Other
1.68k stars 217 forks source link

Keyboard sequence `ctrl+alt+e` interfere with € sign on Windows #323

Closed cfehse closed 5 years ago

cfehse commented 5 years ago

VS code interprets ctrl+alt+e in all editors and input fields as the character and as part of a keyboard shortcut simply as the e character on Windows. The extension defines a shortcut ctrl+alt+c ctrl+alt+e which is therefore executed as the chord ctrl+alt+c e.

So the command "Send current form to REPL window" always executed "Evaluate current form inline" when invoked through the keyboard shortcut even though the same command invoked using the command prompt (ctrl+shift+p) triggers the expected command.

cfehse commented 5 years ago

A possible solution for this problem would be to change the default binding:

to keep the symmetry. I tested this keyboard shortcuts under Windows und Linux and it works as expected.

PEZ commented 5 years ago

The default binding was changed to ctrl+alt+e because that with some kombination of languages and operating system the previous shortcut produced some other glyph. It's entirely possible that ctrl+alt+v produces a glyph for someone.

It is a bit insane that VS Code does this. There should be an issue filed about it.

Until then, it is probably better to update the README with the gotcha and have a wiki page that can provide some tips and collect suggestions on how to customize the shortcut.

cfehse commented 5 years ago

You can do this, but with the current default binding for one of the most important commands you can be sure that all windows user with:

keyboard layouts will have this problem. It cost me over an hour to figure it out (I will open a bug for VScode as well). I am currently looking how to attract people to clojure and having an understandable IDE with an at least good REPL development workflow seems essential. Cursive is in many ways better but here the workflow is much how the lispian way should be at least I think. So I will go through the different keyboard layouts and try out what happends. I tried the major locales (include Swedish) and ctrl+alt+v works and and ctrl+alt+e does not.

PEZ commented 5 years ago

Thanks for insisting. Not good with defaults that fail for such a large category of users.

cfehse commented 5 years ago

I opened an issue for vscode for this behavior. Let's see what happens on there side. I will test the remaining layouts und report, if they all work.

kstehn commented 5 years ago

I dont understand this issue. When i test it on windows with German Layout (also with Neo2) i dont get any problems.

When i press ctrl+alt+c ctrl+alt+e it sends the form to the nrepl window without any problems.

cfehse commented 5 years ago

@kstehn Please open die "Keyboard Shortcuts" and try to change/add a shortcut containing ctrl+alt+e. Does the editor work as extected? I tested it on 3 different machines and on all systems the sequence was translated to e.

cfehse commented 5 years ago

@kstehn Which locale is configured on your Windows system?

cfehse commented 5 years ago

@kstehn What character produces ctrl+alt+e in an source editor windows? On my system it produces die € character.

kstehn commented 5 years ago

@cfehse the local is deDE and when i change keybind to ctrl+alt+e it sends the form to the window. Without the keybind change i also do get €

cfehse commented 5 years ago

@kstehn I can reproduce the behavior on Windows 7 and 10 with English and German Locale and German(Germany) keyboard layout. I will take a deeper look into this. Thanks.

PEZ commented 5 years ago

Let me get this straight... So on deDe locale, both alt+e and ctrl+alt+e (unbound by Calva) produces ?

kstehn commented 5 years ago

yeah i didnt know this either

PEZ commented 5 years ago

Is this only in VS Code or generally?

PEZ commented 5 years ago

VS Code interpreting the second chord of a keyboard shortcut that way is a separate and insane matter...

kstehn commented 5 years ago

no its also in my browser so

cfehse commented 5 years ago

@kstehn @PEZ I will look a some stock Windows system tomorrow - installations I have never touched. So I will see if I can reproduce the issue there.

cfehse commented 5 years ago

So I tried on a new system:

Ctrl-Alt-e-vscode-windows-10

kstehn commented 5 years ago

That looks wierd. Same System and it looks like this:

keybinding

cfehse commented 5 years ago

@kstehn Is your system native or hosted in a virtual machine?

kstehn commented 5 years ago

@cfehse its native

cfehse commented 5 years ago

@kstehn okay let's have the vscode guys take a look at this. Even in Notepad++ I can define a shortcut for ctrl+alt+e and it works like a charm.

PEZ commented 5 years ago

Did v2.0.40 fix this? If so, close the issue.

cfehse commented 5 years ago

@PEZ Yes you changed this on Windows.

Nevertheless I leave a reference to the corresponding vscode issue: Windows Ctrl+Alt+E get translated in keyboard shortcut as E