Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/docs/config.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ wsh editconfig
| window:disablehardwareacceleration | bool | set to disable Chromium hardware acceleration to resolve graphical bugs (requires app restart) |
| window:fullscreenonlaunch | bool | set to true to launch the foreground window in fullscreen mode (defaults to false) |
| window:savelastwindow | bool | when `true`, the last window that is closed is preserved and is reopened the next time the app is launched (defaults to `true`) |
| window:restoreallwindows | bool | when `true`, all open windows (not just the last one) are preserved when closed and reopened the next time the app is launched, keeping their workspaces, tabs, and terminal working directories (defaults to `true`) |
| window:confirmonclose | bool | when `true`, a prompt will ask a user to confirm that they want to close a window if it has an unsaved workspace with more than one tab (defaults to `true`) |
| window:dimensions | string | set the default dimensions for new windows using the format "WIDTHxHEIGHT" (e.g. "1920x1080"). when a new window is created, these dimensions will be automatically applied. The width and height values should be specified in pixels. |
| telemetry:enabled | bool | set to enable/disable telemetry |
Expand Down
5 changes: 4 additions & 1 deletion emain/emain-window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,10 @@ export class WaveBrowserWindow extends BaseWindow {
fireAndForget(async () => {
const numWindows = waveWindowMap.size;
const fullConfig = await RpcApi.GetFullConfigCommand(ElectronWshClient);
if (numWindows > 1 || !fullConfig.settings["window:savelastwindow"]) {
const preserveThisWindow =
fullConfig.settings["window:restoreallwindows"] ||
(numWindows === 1 && fullConfig.settings["window:savelastwindow"]);
if (!preserveThisWindow) {
if (fullConfig.settings["window:confirmclose"]) {
const workspace = await WorkspaceService.GetWorkspace(this.workspaceId);
if (isNonEmptyUnsavedWorkspace(workspace)) {
Expand Down
1 change: 1 addition & 0 deletions frontend/types/gotypes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1467,6 +1467,7 @@ declare global {
"window:magnifiedblockblursecondarypx"?: number;
"window:confirmclose"?: boolean;
"window:savelastwindow"?: boolean;
"window:restoreallwindows"?: boolean;
"window:dimensions"?: string;
"window:zoom"?: number;
"telemetry:*"?: boolean;
Expand Down
1 change: 1 addition & 0 deletions pkg/wconfig/defaultconfig/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"window:magnifiedblockblursecondarypx": 2,
"window:confirmclose": true,
"window:savelastwindow": true,
"window:restoreallwindows": true,
"telemetry:enabled": true,
"term:bellsound": false,
"term:bellindicator": true,
Expand Down
1 change: 1 addition & 0 deletions pkg/wconfig/metaconsts.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ const (
ConfigKey_WindowMagnifiedBlockBlurSecondaryPx = "window:magnifiedblockblursecondarypx"
ConfigKey_WindowConfirmClose = "window:confirmclose"
ConfigKey_WindowSaveLastWindow = "window:savelastwindow"
ConfigKey_WindowRestoreAllWindows = "window:restoreallwindows"
ConfigKey_WindowDimensions = "window:dimensions"
ConfigKey_WindowZoom = "window:zoom"

Expand Down
1 change: 1 addition & 0 deletions pkg/wconfig/settingsconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ type SettingsType struct {
WindowMagnifiedBlockBlurSecondaryPx *int64 `json:"window:magnifiedblockblursecondarypx,omitempty"`
WindowConfirmClose bool `json:"window:confirmclose,omitempty"`
WindowSaveLastWindow bool `json:"window:savelastwindow,omitempty"`
WindowRestoreAllWindows bool `json:"window:restoreallwindows,omitempty"`
WindowDimensions string `json:"window:dimensions,omitempty"`
WindowZoom *float64 `json:"window:zoom,omitempty"`

Expand Down
3 changes: 3 additions & 0 deletions schema/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,9 @@
"window:savelastwindow": {
"type": "boolean"
},
"window:restoreallwindows": {
"type": "boolean"
},
"window:dimensions": {
"type": "string"
},
Expand Down