mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-01-02 18:39:05 +01: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
@ -691,6 +691,43 @@ function getAppMenu() {
|
|||||||
appMenu.push({
|
appMenu.push({
|
||||||
role: "quit",
|
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[] = [
|
const viewMenu: Electron.MenuItemConstructorOptions[] = [
|
||||||
{
|
{
|
||||||
role: "forceReload",
|
role: "forceReload",
|
||||||
@ -763,6 +800,7 @@ function getAppMenu() {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
role: "editMenu",
|
role: "editMenu",
|
||||||
|
submenu: editMenu,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
role: "viewMenu",
|
role: "viewMenu",
|
||||||
|
Loading…
Reference in New Issue
Block a user