Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
refactor(cli/load,tests) Migrate display-message to typed wrapper #1039
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Uh oh!
There was an error while loading. Please reload this page.
refactor(cli/load,tests) Migrate display-message to typed wrapper #1039
Changes from 1 commit
c54893e46b52f1File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
why: Six tests in the plugin-system suite were querying tmux for session/window names via the same `session.cmd("display-message", "-p", "'#S'")` escape hatch that production just migrated away from in `cli/load.py:_reattach`. Keeping the tests on the typed wrapper that production now uses keeps the call shape consistent across the codebase and removes the last `cmd("display-message", ...)` site from the repo. what: - `tests/cli/test_cli.py::test_reattach_plugins`: replace the `cmd()` call with `active_pane.display_message("'#S'", get_text=True)` so the post-reattach assertion uses the typed wrapper. - `tests/workspace/test_builder.py`: migrate four `test_plugin_system_*` checks (`before_workspace_builder`, `on_window_create`, `after_window_finished`, and the multi-window variant covering both `before_script` and `after_window_finished`) onto `active_pane.display_message()`. The multi-window variant hoists the active_pane lookup once and reuses it for both the `'#S'` and `'#W'` queries. - Each call site adds a narrowing assert on `active_pane` (libtmux types it as `Pane | None`) so mypy can prove the call is well-typed. Mirrors the production assert added in `_reattach()`. No behavior change: tmux's `display-message` defaults to the session's active pane when no `-t` is passed, so the underlying tmux invocations are byte-for-byte identical to the prior `session.cmd(...)` calls.Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing