Repository navigation
Conversation
Contributor
|
The following comment was made by an LLM, it may be inaccurate: |
Member
|
This branch has been upgraded to V2. We're no longer taking PRs for V1. If you think this is still relevant, please port it over and open it for V2. — from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊 |
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #52683
Type of change
What does this PR do?
On Windows and Linux the desktop app never installs its own application menu:
createMenu()returns immediately unless the platform isdarwin. With no menuset, Electron keeps its default application menu, whose window menu binds the
closerole toCommandOrControl+W. That accelerator runs in the main processand closes the whole window before the renderer's
tab.closekeybind(
mod+w,packages/app/src/pages/session/use-session-commands.tsx:529) can run,so Ctrl+W closed the app instead of the active tab.
The window menu bar is hidden anyway (
autoHideMenuBar: trueinpackages/desktop/src/main/windows.ts), so on Windows/Linux this menu is onlyused for its accelerators. This PR installs an equivalent menu on non-macOS
(
fileMenu/editMenu/viewMenuplus a Window menu with onlyminimize),omitting the window-close accelerator. Ctrl+W then reaches the renderer and
closes the tab/terminal as intended, while reload, zoom, fullscreen, minimize
and quit keep working.
macOS is unchanged — it already builds its own menu. Same class as #34937 and
#37610 (which was fixed on the renderer side for macOS), but this is the
Windows/Linux code path.
How did you verify your code works?
bun run --cwd packages/desktop typecheckoxlint packages/desktop/src/main/menu.tsbun run dev:desktop): with two or more sessiontabs, Ctrl+W closes the active tab and the window stays open; Ctrl+R,
Ctrl+0/+/-, F11, Ctrl+M and Ctrl+Q still work.
Screenshots / recordings
N/A — no visual change.
Checklist