posit-dev / positron

Positron, a next-generation data science IDE
Other
2.57k stars 79 forks source link

cntrl+shift+n File -> New Window opens a script #4460

Closed asadow closed 1 month ago

asadow commented 1 month ago

System details:

Positron and OS details:

Positron Version: 2024.08.0 (system setup) build 48 Code - OSS Version: 1.91.0 Commit: ed616b36655fb24d116108bdd833f1321704315b Date: 2024-08-19T03:30:12.447Z Electron: 29.4.0 Chromium: 122.0.6261.156 Node.js: 20.9.0 V8: 12.2.281.27-electron.0 OS: Windows_NT x64 10.0.22631

Interpreter details:

R 4.4.1

Describe the issue:

cntrl+shift+n File -> New Window opens a script

Expected or desired behavior:

New Positron window

juliasilge commented 1 month ago

Thanks for this report! I can confirm that as of build 48, both Cmd+N and Cmd+Shift+N open a new file and I cannot open a new window via keyboard shortcut at all. This is what the menu says (choosing the option in the menu still works):

Screenshot 2024-08-23 at 8 35 52 AM

This must be a recent regression because I was able to open a new window via keyboard shortcut fairly recently.

DavisVaughan commented 1 month ago

With build 48, CMD + Shift + N works as expected for me and opens a new window

juliasilge commented 1 month ago

It's the RStudio Keymap. When it is turned on, Cmd+Shift+N opens a new file instead of a new window:

https://github.com/posit-dev/positron/blob/fa78131f2a5a8a43eb6ebc60f78bf39f40dce4f4/extensions/positron-rstudio-keymap/package.json#L58

DavisVaughan commented 1 month ago

So, not a bug?

juliasilge commented 1 month ago

This is sort of related to https://github.com/posit-dev/positron/issues/2423 and the issues linked there where we have a keyboard shortcut shown in the UI which does not actually work in some situations.

juliasilge commented 1 month ago

So, not a bug?

I think it's reasonable to call this a bug; we have called #3847 and related issues bugs.

@asadow as a workaround, if you want to opt in to the RStudio Keymap but not to this particular shortcut, you can create a personal user keybinding to override it; it will take precedence. From the command palette you would choose "Open Keyboard Shortcuts (JSON") and add this to create the keybinding for you:

    {
        "key": "ctrl+shift+n",
        "command": "workbench.action.newWindow",
    }
DavisVaughan commented 1 month ago

The bug is just that it shows the keycode for CMD + Shift + N beside the File -> New Window UI element, even though that combination has been overridden by the RStudio keymap, right?

jennybc commented 1 month ago

I think this problem about menus displaying keybindings that are not accurate, in light of extensions and user configuration is a general VS Code problem. That doesn't mean we can't or shouldn't solve it. But I don't think it's a problem of Positron's (sole) making.

juliasilge commented 1 month ago

This is actually exactly the same as #3400 so let's track this problem there. 👍