From 73152f59f1bae9ff5a956a185e2ddbbb23ef0b6b Mon Sep 17 00:00:00 2001 From: Typing Turtle Date: Tue, 23 Jul 2024 15:28:43 -0400 Subject: [PATCH] Adds load on startup instructions to README.md Adds an optional setup step that others may find useful for restoring the previous session state when the program loads --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index 8002447..0407a42 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,19 @@ and restore different sessions or better workspaces and later restore them. [here](https://wezfurlong.org/wezterm/config/lua/keyassignment/SwitchToWorkspace.html). This helps managing and switching states. +6. Optionally, load the previous configuration using the `gui-startup` event: + + ```lua + local mux = wezterm.mux + wezterm.on("gui-startup", function(cmd) + local tab, pane, window = mux.spawn_window(cmd or {}) + -- maximize window when open + -- window:gui_window():maximize() + -- restore previous session state + session_manager.restore_state(window:gui_window()) + end) + ``` + ## Limitations There are currently some limitations and improvements that need to be