mirror of
https://github.com/wavetermdev/waveterm
synced 2026-05-23 08:48:28 +00:00
Replace default edit menu with one that won't eat keyboard shortcuts (#274)
We only need global Cut/Copy/Paste accelerators on macOS. Linux and Windows do these automatically. Additionally, having these accelerators means that we can't use shortcuts like Ctrl+C in the terminal. This PR removes these accelerators for every platform but macOS.
This commit is contained in:
parent
3777cd1eb0
commit
59a2b9b787
1 changed files with 38 additions and 0 deletions
|
|
@ -691,6 +691,43 @@ function getAppMenu() {
|
|||
appMenu.push({
|
||||
role: "quit",
|
||||
});
|
||||
const editMenu: Electron.MenuItemConstructorOptions[] = [
|
||||
{
|
||||
role: "undo",
|
||||
accelerator: unamePlatform === "darwin" ? "Command+Z" : "",
|
||||
},
|
||||
{
|
||||
role: "redo",
|
||||
accelerator: unamePlatform === "darwin" ? "Command+Shift+Z" : "",
|
||||
},
|
||||
{
|
||||
type: "separator",
|
||||
},
|
||||
{
|
||||
role: "cut",
|
||||
accelerator: unamePlatform === "darwin" ? "Command+X" : "",
|
||||
},
|
||||
{
|
||||
role: "copy",
|
||||
accelerator: unamePlatform === "darwin" ? "Command+C" : "",
|
||||
},
|
||||
{
|
||||
role: "paste",
|
||||
accelerator: unamePlatform === "darwin" ? "Command+V" : "",
|
||||
},
|
||||
{
|
||||
role: "pasteAndMatchStyle",
|
||||
accelerator: unamePlatform === "darwin" ? "Command+Shift+V" : "",
|
||||
},
|
||||
{
|
||||
role: "delete",
|
||||
},
|
||||
{
|
||||
role: "selectAll",
|
||||
accelerator: unamePlatform === "darwin" ? "Command+A" : "",
|
||||
},
|
||||
];
|
||||
|
||||
const viewMenu: Electron.MenuItemConstructorOptions[] = [
|
||||
{
|
||||
role: "forceReload",
|
||||
|
|
@ -763,6 +800,7 @@ function getAppMenu() {
|
|||
},
|
||||
{
|
||||
role: "editMenu",
|
||||
submenu: editMenu,
|
||||
},
|
||||
{
|
||||
role: "viewMenu",
|
||||
|
|
|
|||
Loading…
Reference in a new issue