Repository navigation
fix(tmux): expand short format aliases in tmux compat #3206
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -269,6 +269,10 @@ def main() -> int: | |||||||||||
| shown = _run_cli(cli, ["display-message", "-p", msg]) | ||||||||||||
| _must(msg in shown.stdout, f"display-message -p should print message: {shown.stdout!r}") | ||||||||||||
|
|
||||||||||||
| short_aliases = _run_cli(cli, ["display-message", "-p", "#S:#I.#P #W"]) | ||||||||||||
| _must(short_aliases.stdout.strip() == f"cmux:0.0 {ws}", | ||||||||||||
| f"display-message short aliases should expand: {short_aliases.stdout!r}") | ||||||||||||
|
Comment on lines
+273
to
+274
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Comment on lines
+272
to
+274
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The assertion
Comment on lines
+272
to
+274
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Avoid hard-coding dynamic tmux context values in this regression assertion. At Line 184 the test renames the window, and Suggested fix- short_aliases = _run_cli(cli, ["display-message", "-p", "#S:`#I`.#P `#W`"])
- _must(short_aliases.stdout.strip() == f"cmux:0.0 {ws}",
- f"display-message short aliases should expand: {short_aliases.stdout!r}")
+ long_form = _run_cli(
+ cli,
+ ["display-message", "-p", "#{session_name}:#{window_index}.#{pane_index} #{window_name}"],
+ )
+ short_aliases = _run_cli(cli, ["display-message", "-p", "#S:`#I`.#P `#W`"])
+ _must(
+ short_aliases.stdout.strip() == long_form.stdout.strip(),
+ f"display-message short aliases should match long-form render: short={short_aliases.stdout!r} long={long_form.stdout!r}",
+ )🤖 Prompt for AI Agents |
||||||||||||
|
|
||||||||||||
| print("PASS: tmux compatibility matrix commands are wired and tested") | ||||||||||||
| return 0 | ||||||||||||
|
|
||||||||||||
|
|
||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a recognized alias (e.g.
#I) appears in the format string but its context key (window_index) is absent from the map, the#is emitted and the loop advances to the alias letter, which is then emitted on the next iteration — reproducing the original#Iliterally. This passthrough is reasonable, but it diverges slightly from real tmux which would render an empty string. A brief comment clarifying the intended behavior would help future readers distinguish a deliberate design choice from a bug.