posit-dev / positron

Positron, a next-generation data science IDE
Other
2.5k stars 77 forks source link

ctrl+shift+c opens terminal in ubuntu #3847

Closed oranwutang closed 1 month ago

oranwutang commented 3 months ago

Positron Version:

Positron Version: 2024.06.1 build 54 Code - OSS Version: 1.90.0 Commit: 5115c73e0670f39139e55eeedf0717b468a0658d Date: 2024-07-03T03:04:49.029Z Electron: 29.4.0 Chromium: 122.0.6261.156 Node.js: 20.9.0 V8: 12.2.281.27-electron.0 OS: Linux x64 6.5.0-41-generic

Hi!

I'm using positron on Ubuntu 22.04.4 LTS x86_64 and while trying to comment a line in code editor using the shortcut (ctrl+shift+c), what I get is a terminal window opened and the line is not commented.

FWIW, pressing ctrl+shift+c in VSCode has the same behaviour, in VSCode the shortcut for commenting is ctrl+shift+7, it also works on Positron

For obvious reason I think this is a very critical issue!

Thanks in advance for your work with Positron, I've just installed it and I'm enjoying a lot trying all the new features!

Steps to reproduce the issue:

  1. Try to use the shortut to comment a line (ctrl+sfiht+c)

What did you expect to happen?

Get the line commented

Were there any error messages in the output or Developer Tools console?

No

oranwutang commented 3 months ago

Additional info: pressing ctrl+shift+A won't do anything!

juliasilge commented 3 months ago

Related to #3830

Do you have the RStudio Keymap enabled? You can do that in settings:

image

Without the RStudio Keymap enabled, you'll get the default VS Code behavior for this key combo, which is indeed to open a terminal.

oranwutang commented 3 months ago

Oh, I'm sorry, effectively it works.

Anyways, I think that a program should do what it says it does, specially after a "standard" installation.

Let's say that a completely newbie (who doesn't know a thing about RStudio or VSCode) installs Positron, he goes to the menu edit and see this:

image

But the shortcuts stated on the menu doesn't work, unless he does some kind of trick...

I think that if the standard installation doesn't offer the RStudio keymap by default, then it should have consistency between the shortcuts mentioned in the menus and the correct corresponding keymap.

It's just my very humble opinion :)

Thanks for your prompt and kind answer, Julia!

Best regards

juliasilge commented 3 months ago

Oh wow, I had not noticed this before. Thanks for the report! 🙌

I think by providing a keybinding here: https://github.com/posit-dev/positron/blob/09eefeefd1f130080c9d48157d794573f3166c15/extensions/positron-rstudio-keymap/package.json#L82 we are overriding what shows up in the native "Edit" menu, even when the RStudio Keymap is not enabled. I just tried out a dev build and if I remove this keybinding, the native "Edit" menu goes back to the VS Code default.

This is sort of related to #2423 where we have a keyboard shortcut shown in the UI which does not actually work in some situations.

oranwutang commented 3 months ago

Do you have a way to make RStudio keymap activated by default after a vanilla installation of Positron? Maybe that's a solution, but I don't know if it is feasible or desirable.

petetronic commented 2 months ago

We won't make that keymap the default, but we should make sure a disabled RStudio Keymap mode does not show incorrect key bindings in menus.

juliasilge commented 1 month ago

Let's track this and related problems in #3993. Thanks! 🙌