Skip to content

Workspace(feat[runtime]): Add pane title and synchronization keys#1047

Open
tony wants to merge 14 commits into
masterfrom
parity-runtime-config
Open

Workspace(feat[runtime]): Add pane title and synchronization keys#1047
tony wants to merge 14 commits into
masterfrom
parity-runtime-config

Conversation

@tony
Copy link
Copy Markdown
Member

@tony tony commented Jun 6, 2026

Summary

Split from the parity recut work to keep the runtime config surface reviewable.

  • add synchronize, shell_command_after, clear, and pane title config handling
  • ensure shell_command_after and clear run before options_after, so synchronize: after does not duplicate commands
  • document the runtime keys with focused examples and builder/config coverage

Verification

Ran before commit:

$ rm -rf docs/_build; uv run ruff check . --fix --show-fixes; uv run ruff format .; uv run mypy; uv run py.test --reruns 0 -vvv; just build-docs;

Result: ruff clean, format unchanged, mypy clean, pytest 815 passed, 2 skipped, docs built successfully.

Stack: base PR for lifecycle hooks and importer fallback follow-ups.

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 6, 2026

Codecov Report

❌ Patch coverage is 95.65217% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.50%. Comparing base (700a9b9) to head (a45ab9b).

Files with missing lines Patch % Lines
src/tmuxp/workspace/builder.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    #1047      +/-   ##
==========================================
+ Coverage   81.98%   82.50%   +0.51%     
==========================================
  Files          28       28              
  Lines        2548     2652     +104     
  Branches      485      516      +31     
==========================================
+ Hits         2089     2188      +99     
- Misses        328      330       +2     
- Partials      131      134       +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.

tony added 5 commits June 7, 2026 06:28
why: Expose the core tmux runtime primitives needed for parity before
layering importer translations on top.
what:
- Normalize synchronize, shell_command_after, clear, and pane title
  config keys in the loader
- Apply after-commands and clear before options_after so synchronized
  panes do not duplicate commands
why: Pin the loader desugaring and builder behavior for the new
runtime config keys.
what:
- Builder integration tests for synchronize, shell_command_after,
  clear, and pane titles
- Loader expand tests for key normalization and defaults
why: Give users working references for the new runtime config keys.
what:
- Top-level configuration sections for pane titles, synchronize,
  shell_command_after, and clear
- Example workspace files for pane titles and synchronize shorthand
why: Preserve tmuxp's default shell history suppression for post-build
window commands.
what:
- Pass the window suppress_history setting to shell_command_after and
  clear send_keys calls
why: Pin default and explicit shell history suppression for
shell_command_after and clear.
what:
- Parametrized builder coverage for default-on, explicit-off, and
  explicit-on suppress_history with post-build commands
@tony tony force-pushed the parity-runtime-config branch from 99fbb1b to 61a6df4 Compare June 7, 2026 11:46
@tony
Copy link
Copy Markdown
Member Author

tony commented Jun 7, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

🤖 Generated with Claude Code

…ion warning

why: The warning carried no structured fields, forcing the test to
match message substrings against the logging standards.
what:
- Add tmux_session extra to the invalid pane_title_position warning
- Assert the warning via schema fields instead of message text
@tony
Copy link
Copy Markdown
Member Author

tony commented Jun 7, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

🤖 Generated with Claude Code

why: Document the runtime config deliverables for the upcoming
release: native pane labeling and the synchronize,
shell_command_after, and clear window keys.
what:
- Add What's new deliverable entries below the unreleased placeholder
- Cross-reference the top-level configuration docs
tony added 7 commits June 7, 2026 09:34
…fter

why: expand_cmd normalizes after-commands into the same mappings as
shell_command, but the post-build fan-out sent only the command text —
enter: false and sleep_before/sleep_after were silently dropped,
unlike regular pane commands using identical syntax.
what:
- Read enter and sleep options per command in config_after_window;
  sleeps run once per command wave, not once per pane
- Spy-based tests pinning enter propagation and per-wave sleep counts
- Document the mapping form in the shell_command_after section
why: An explicit title: "" was silently dropped by a truthiness check,
and forwarding it would no-op anyway — tmux discards select-pane -T ""
entirely. Users blanking a label deserve a signal instead of silence.
what:
- Warn with pane context when title is explicitly empty; non-empty
  titles apply as before
- Cover the warning via schema-field assertions in the pane title test
- Document the tmux limitation and the single-space workaround
… synchronized

why: With synchronize-panes already on (synchronize: before/true or an
explicit option), the fan-out sent to every pane while tmux also
mirrored each send — shell_command_after and clear ran once per pane
per send. The options_after ordering only protects synchronize: after.
what:
- Read the live synchronize-panes state and send to a single pane when
  on, letting tmux broadcast
- Generalize the once-per-pane test across after, before, true, and
  explicit-option modes
why: synchronize-panes broadcasts tmux input whenever it is active, so
applying it before tmuxp sends setup or post-build commands can duplicate
commands across panes.

what:
- Normalize synchronize as a final window state instead of an active setup mode
- Keep synchronize-panes disabled while tmuxp sends pane setup, clear, and shell_command_after keys
- Restore explicit, inherited, and plugin-set final synchronization states after command fan-out
- Cover shorthand, raw option, inherited global, plugin, and invalid-value cases
why: Lower-level callers can use iter_create_windows() directly and expect raw window options to apply immediately. Deferring synchronize-panes unconditionally made that option a no-op outside the high-level build flow.

what:
- Apply synchronize-panes in direct iter_create_windows() calls by default
- Let build() opt into deferring synchronize-panes until the safe restore phase
- Add iterator-level coverage for raw synchronize-panes on/off options
why: synchronize-panes was replayed from parsed config after on_window_create, unlike ordinary window options. That erased plugin changes on configured windows and made the temporary synchronization guard own final state.

what:
- Apply initial synchronize settings as live window state before on_window_create
- Restore captured live sync state after tmuxp-owned key fan-out unless options_after supplies the late value
- Cover on_window_create, options_after, and after_window_finished precedence for synchronize-panes
why: Window setup temporarily disables tmux pane synchronization so pane setup commands do not broadcast across panes. If pane creation or layout application fails, that temporary state must still be restored so partial windows and existing/global tmux state are not left with an unintended local override.
what:
- Restore synchronize-panes from a build-level finally block when pane setup aborts
- Preserve and restore pane-local synchronize-panes overrides while setup is isolated
- Cover raw options, inherited global state, options_after, and plugin-set synchronization state in regression tests
@piotr-dobrogost
Copy link
Copy Markdown

piotr-dobrogost commented Jun 7, 2026

Is this generated by/with the help of AI?
I'm asking because it looks like that's the case, but there is no info on this in the first comment of this pull, only in further comments concerned with code review.

@tony
Copy link
Copy Markdown
Member Author

tony commented Jun 7, 2026

@piotr-dobrogost Yes, and it's split off of #1025.

@tony
Copy link
Copy Markdown
Member Author

tony commented Jun 7, 2026

There is an AGENTS.md, claude config, and comments in here will shout when Claude reviews. I'm steering it with claude and codex ATM.

This particular PR may just need to have synchronize-panes taken out due to how delicate WorkspaceBuilder is when applying it.

@piotr-dobrogost
Copy link
Copy Markdown

@piotr-dobrogost Yes, and it's split off of #1025.

Well, looking at #1025 I do not see information that was generated by AI either. I see Generated with [Claude Code](https://claude.ai/code) only in code review comments. This kind of information should be also/in the first place in the original comment of the pull, no?

@tony
Copy link
Copy Markdown
Member Author

tony commented Jun 7, 2026

I'm all aboard to note AI usage in tmuxp (or any of my projects). It's somewhat obvious from the root of the project, we have AGENTS.md and serveral other configuration files.

To give Anthropic / OpenAI / Cursor / etc. free marketing in commit messages, not so much.

Will continue to monitor the norms / best practices around ettiquete regarding gen ai in open source projects. If you find any, link them up.

@piotr-dobrogost
Copy link
Copy Markdown

To give Anthropic / OpenAI / Cursor / etc. free marketing in commit messages, not so much.

Tagging something with the name of AI that generated changes seems like such an obvious thing to do, I have taken it for granted without even reading up on it. I'm surprised by the idea that it might be treated as "free marketing." Also, you are OK with code reviews tagged by the name of AI but not the pull itself – that's even more bizarre.

Take a look at tomerfiliba/plumbum#812, which is clearly tagged Assisted-by: Claude:claude-opus-4.8.

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.

2 participants