diff --git a/docs/changelog.md b/docs/changelog.md index c2426ad69..264d5ef04 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -16,6 +16,7 @@ As features stabilize some brief notes about them will accumulate here. * [window:copy_to_clipboard](config/lua/window/copy_to_clipboard.md) method for putting arbitrary text into the clipboard/selection. * [window:set_inner_size](config/lua/window/set_inner_size.md) method for controlling window size. * [window:set_position](config/lua/window/set_position.md) method for controlling window position. +* [window:maximize](config/lua/window/maximize.md) and [window:restore](config/lua/window/restore.md) methods for controlling window maximization state. * [window:get_selection_escapes_for_pane](config/lua/window/get_selection_escapes_for_pane.md) method for getting the current selection including escape sequences. [#2223](https://github.com/wez/wezterm/issues/2223) * New [wezterm.gui](config/lua/wezterm.gui/index.md) module and [mux_window:gui_window](config/lua/mux-window/gui_window.md) method. diff --git a/docs/config/lua/gui-events/gui-startup.md b/docs/config/lua/gui-events/gui-startup.md index 7fa5ebde4..50e9a5385 100644 --- a/docs/config/lua/gui-events/gui-startup.md +++ b/docs/config/lua/gui-events/gui-startup.md @@ -34,6 +34,20 @@ end) return {} ``` +This example creates a default window but makes it maximize on startup: + +```lua +local wezterm = require 'wezterm' +local mux = wezterm.mux + +wezterm.on("gui-startup", function() + local tab, pane, window = mux.spawn_window{} + window:gui_window():maximize() +end) + +return {} +``` + Here's a more elaborate example that configures two workspaces: ```lua diff --git a/docs/config/lua/window/maximize.md b/docs/config/lua/window/maximize.md new file mode 100644 index 000000000..71d91ed5e --- /dev/null +++ b/docs/config/lua/window/maximize.md @@ -0,0 +1,7 @@ +# `window:maximize()` + +*Since: nightly builds only* + +Puts the window into the maximized state. + +Use [window:restore()](restore.md) to return to the normal/non-maximized state. diff --git a/docs/config/lua/window/restore.md b/docs/config/lua/window/restore.md new file mode 100644 index 000000000..63e6dc11e --- /dev/null +++ b/docs/config/lua/window/restore.md @@ -0,0 +1,8 @@ +# `window:restore()` + +*Since: nightly builds only* + +Restores the window from the maximized state. + +See also: [window:maximize()](maximize.md). +