Duplicate a session #8
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
A session is a set of GSettings keys under
/me/dusansimic/terminalko/sessions/<uuid>/, described by a relocatable schema(
data/me.dusansimic.terminalko.session.gschema.xml) and wrapped byterminalko_config::Session. There are around twenty keys: name, colour, type,command, cwd, env, login-shell, autostart, persistent, restart, confirm-close,
the ssh trio, the container trio, the escalation pair, and the font, palette and
scrollback overrides.
Store::create_session(folder, name)makes a new one with defaults.The gap
There is no way to copy a session. Setting up a second session that differs from
an existing one in one field means re-entering every field. The original plan
listed Duplicate in the session context menu; it was never implemented.
Approach
Add
Store::duplicate_session(&self, id: &str) -> Sessionincrates/terminalko-config/src/session.rs:appears next to what it was copied from (
create_sessionthenmove_session,or a
create_session_at);SettingsSchema::list_keysgives the names — the same approach
reset_allalready uses for deletion — so akey added later is copied without anyone remembering to update this;
"<name> copy"is enough, and the useris about to rename it anyway;
not a key. If that ever changes, this is where it matters.
Then a
win.session-duplicateaction and a menu entry beside Rename….Acceptance criteria
name, verified by a test that sets a non-default value for each key, copies,
and compares — not a spot check.
restart.
not started automatically.
test above should fail if that stops being true.
./build-aux/ci.shpasses.Notes
crates/terminalko-config/src/session.rs, which runs headless withGSETTINGS_BACKEND=memory— see thewith_storehelper.CONTRIBUTING.mdapply.