Skip to content

Workspace: synchronize, shell_command_after, clear, pane-title keys#1069

Open
tony wants to merge 4 commits into
masterfrom
runtime-config-keys
Open

Workspace: synchronize, shell_command_after, clear, pane-title keys#1069
tony wants to merge 4 commits into
masterfrom
runtime-config-keys

Conversation

@tony

@tony tony commented Jun 29, 2026

Copy link
Copy Markdown
Member

Summary

  • Add runtime config keys: window synchronize (after/before/true/false), shell_command_after, clear; pane title plus session pane-title options.
  • Preserve the shell_command_afterclearoptions_after ordering and the synchronize-panes prepare/restore tri-state so synchronize: after doesn't duplicate commands.

Changes

  • workspace/builder/classic.py, workspace/loader.py, tests, docs (docs/configuration/* + examples), CHANGES.

Supersedes #1047, rebased from the old builder.py onto the builder/classic.py package. This is additive config-key handling, not a new builder.

Test plan

  • full suite / mypy / ruff / build-docs

tony added 3 commits June 28, 2026 20:04
why: Workspaces could not label panes, run a post-build command wave,
clear panes, or set a final pane-synchronization state without spelling
out raw tmux options. Layer these keys onto the classic builder so the
behavior stays additive and no new builder or entry point is needed.

what:
- Expand session enable_pane_titles/pane_title_position/pane_title_format
  into per-window pane-border options; expand window synchronize into a
  tri-state final sync flag and shell_command_after via expand_cmd
- Force synchronize-panes off (window- and pane-local) while panes and
  post-build commands run, then restore the configured final state
- Send shell_command_after, then clear, then options_after with sync off
  so synchronize:after never duplicates commands across panes
- Apply pane title via pane.set_title after pane commands; warn on empty
why: Cover the new pane title, synchronize, shell_command_after, and
clear keys through both config expansion and a live build, including
synchronize isolation, setup-abort restoration, and plugin precedence.

what:
- Add expand() tests for synchronize, shell_command_after, pane titles
- Add build tests for sync isolation/restore, pane titles, clear, and
  per-command options in shell_command_after fan-out
- Match marker output with a prompt-tolerant helper so /bin/sh panes
  (no readiness wait) do not flake when the prompt shares the row
why: Document the new pane title, synchronize, shell_command_after, and
clear keys with copyable examples so users can adopt them.

what:
- Document pane titles, synchronize, shell_command_after, clear in the
  top-level config reference with focused YAML snippets
- Add pane-titles and synchronize-shorthand examples and reference them
  from the examples gallery
- Note the runtime keys under CHANGES 1.74.0 What's new
@tony tony changed the title Workspace: synchronize, shell_command_after, clear, pane-title keys Workspace: synchronize, shell_command_after, clear, pane-title keys Jun 29, 2026
@codecov

codecov Bot commented Jun 29, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.65217% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.02%. Comparing base (812dcca) to head (0090bdc).

Files with missing lines Patch % Lines
src/tmuxp/workspace/builder/classic.py 95.29% 2 Missing and 2 partials ⚠️
src/tmuxp/workspace/loader.py 96.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1069      +/-   ##
==========================================
+ Coverage   82.56%   83.02%   +0.45%     
==========================================
  Files          31       31              
  Lines        2770     2874     +104     
  Branches      518      549      +31     
==========================================
+ Hits         2287     2386      +99     
- Misses        346      348       +2     
- Partials      137      140       +3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

why: the synchronize-restore-on-abort test triggered the abort with an
invalid tmux layout. tmux's invalid-layout wording varies by version
and crashes the server outright on tmux 3.3a, so the test failed across
the CI matrix though it passed on a single local tmux version.

what:
- Inject the abort in Python by monkeypatching iter_create_panes to
  raise, after synchronize-panes is disabled and before it is restored
- Drop the version-fragile invalid-layout trigger and its message match
@tony tony force-pushed the runtime-config-keys branch from 49519b5 to 0090bdc Compare June 29, 2026 02:05
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