Skip to content

Preferences > Layouts > Add: record each terminal's working directory - #1138

Open
WB3IHY wants to merge 1 commit into
gnome-terminator:masterfrom
WB3IHY:layout-add-save-working-directory
Open

WB3IHY wants to merge 1 commit into
gnome-terminator:masterfrom
WB3IHY:layout-add-save-working-directory

Conversation

@WB3IHY

@WB3IHY WB3IHY commented Nov 4, 2026

Copy link
Copy Markdown

Related to #760.

Problem
Preferences > Layouts > Add saves the splits, sizes and profiles of the current window,
but not the working directory of each terminal. A layout made with Add therefore opens every
pane in the home directory. The SaveLastSessionLayout and SaveUserSessionLayout plugins do
record directories, so the information is available; Add just doesn't ask for it.

Cause
PrefsEditor.on_layoutaddbutton_clicked() calls terminator.describe_layout() with the default
save_cwd=False, so Terminal.describe_layout() skips layout['directory'].

Fix
Call terminator.describe_layout(save_cwd=True) in the Add handler. I left the Refresh handler
alone on purpose: since #882 it copies the directory, command and profile already stored in the
selected layout, so directories typed into the layout editor survive a Refresh.

Testing (Terminator 2.1.6 release tarball, Ubuntu 22.04 / Mint 21.3, X11)

  • Before: opened a 3-pane layout, cd'd the panes to different folders, clicked Add. The saved
    layout has no directory lines.
  • After: same steps. The saved layout has directory = ... for all three terminals, matching the
    folders the panes were in, plus the split ratios I had dragged to.
  • Opening a layout that has directory lines starts the panes in those folders.
  • Not tested: Add while a pane is running a non-shell command, and macOS.
  • I did not add an automated test: the handler needs a running GTK window. Happy to add one if
    you have a pattern for testing PrefsEditor.

The same one-line change is present on current master (line 1637 at the time of writing).

Prepared with help from Claude Code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant