feat: restore tabs and splits at launch

The tab layout (tab order and names, pins, the active tab, split trees
with their ratios) is saved whenever it changes — checked once a second,
written only on change, so it survives a crash — and reopened at the
next launch: saved profiles reconnect and local shells start in the
directory they were in (on Linux the live /proc cwd, so it isn't one
command behind). Quick Connect tabs and placeholder panes are skipped.
A General setting turns it off; it never runs when launched with
--connect, --run-local or --open, and screenshot runs never save.

Verified: a local tab left in /usr/share came back there with a
'Restored 1 tab(s)' toast.
This commit is contained in:
Andy Dixon
2026-10-12 18:53:00 +01:00
parent 469acb1203
commit 1990fb5da9
11 changed files with 247 additions and 1 deletions
+3
View File
@@ -621,6 +621,8 @@ pub struct AppPreferences {
pub allow_remote_clipboard: bool,
/// Ask before pasting multi-line text into a terminal that isn't in bracketed-paste mode.
pub confirm_multiline_paste: bool,
/// Reopen the previous session's tabs and splits at launch.
pub restore_sessions: bool,
}
impl Default for AppPreferences {
@@ -642,6 +644,7 @@ impl Default for AppPreferences {
check_for_updates: true,
allow_remote_clipboard: true,
confirm_multiline_paste: true,
restore_sessions: true,
}
}
}