Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.46 New file/window menu items not functional with no window open #99998

Closed
richardowen opened this issue Jun 12, 2020 · 6 comments · Fixed by #100233
Closed

v1.46 New file/window menu items not functional with no window open #99998

richardowen opened this issue Jun 12, 2020 · 6 comments · Fixed by #100233
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug candidate Issue identified as probable candidate for fixing in the next release macos Issues with VS Code on MAC/OS X menus Menu items and widget issues verified Verification succeeded

Comments

@richardowen
Copy link

Versions

  • VSCode Version: 1.46.0
  • OS Version: macOS 10.15.5 (Darwin x64 19.5.0)

Overview

In v1.46, the new file & new window menu items do not do anything when all windows are closed. The behaviour is the same with the keyboard shortcuts (Cmd+N, Cmd+Shift+N).

The bug is not present in v1.45.1.
The bug is present in the insiders build.

Steps to Reproduce

  1. Open Visual Studio Code
  2. Close all windows
  3. From the File menu, choose either "New File" or "New Window"

Expected Result

  1. A new file or window is opened

Actual Result

  1. Nothing happens

Does this issue occur when all extensions are disabled?: Yes

@gjsjohnmurray
Copy link
Contributor

Duplicate of #99831 but this one has a better title and clearer description, and reports the problem occurring from menu options as well as keybindings.

I was not able to reproduce it on Windows, so it seems to be macOS-specific.

@richardowen
Copy link
Author

Yep it's the same issue. I'm afraid I didn't find that one while searching for duplicates.

@bpasero bpasero assigned sbatten and unassigned bpasero Jun 15, 2020
@bpasero bpasero added the menus Menu items and widget issues label Jun 15, 2020
@sbatten sbatten added the bug Issue identified by VS Code Team member as probable bug label Jun 15, 2020
@sbatten sbatten added this to the May 2020 Recovery milestone Jun 15, 2020
@sbatten
Copy link
Member

sbatten commented Jun 15, 2020

I haven't found out the cause yet, but I can repro.

@sbatten
Copy link
Member

sbatten commented Jun 15, 2020

Looks like it was introduced by this change. 5356ceb

win is undefined when no window is open

this.fallbackMenuHandlers['workbench.action.files.newUntitledFile'] = (menuItem, win, event) => this.windowsMainService.openEmptyWindow({ context: OpenContext.MENU, contextWindowId: win.id });
this.fallbackMenuHandlers['workbench.action.newWindow'] = (menuItem, win, event) => this.windowsMainService.openEmptyWindow({ context: OpenContext.MENU, contextWindowId: win.id });
this.fallbackMenuHandlers['workbench.action.files.openFileFolder'] = (menuItem, win, event) => this.electronMainService.pickFileFolderAndOpen(undefined, { forceNewWindow: this.isOptionClick(event), telemetryExtraData: { from: telemetryFrom } });
this.fallbackMenuHandlers['workbench.action.openWorkspace'] = (menuItem, win, event) => this.electronMainService.pickWorkspaceAndOpen(undefined, { forceNewWindow: this.isOptionClick(event), telemetryExtraData: { from: telemetryFrom } });

@sbatten sbatten assigned bpasero and unassigned sbatten Jun 15, 2020
sbatten added a commit that referenced this issue Jun 15, 2020
@sbatten sbatten added the candidate Issue identified as probable candidate for fixing in the next release label Jun 15, 2020
@sbatten sbatten linked a pull request Jun 15, 2020 that will close this issue
@sbatten sbatten reopened this Jun 15, 2020
@tabaddor
Copy link
Contributor

Is this still unresolved? I can't seem to reproduce this issue.

bpasero added a commit that referenced this issue Jun 16, 2020
bpasero pushed a commit that referenced this issue Jun 16, 2020
@bpasero
Copy link
Member

bpasero commented Jun 16, 2020

@sbatten thanks for the fix, yes this was a regression I introduced. I filed electron/electron#24144 because the TypeScript types are not catching this issue.

@bpasero bpasero closed this as completed Jun 16, 2020
@bpasero bpasero added macos Issues with VS Code on MAC/OS X verified Verification succeeded labels Jun 16, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Jul 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug candidate Issue identified as probable candidate for fixing in the next release macos Issues with VS Code on MAC/OS X menus Menu items and widget issues verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants
@bpasero @richardowen @sbatten @gjsjohnmurray @tabaddor and others