Disable allow-rename on tool windows (match new_window)
nvim/lazygit emit OSC title sequences; without allow-rename off a tool could overwrite the window name and scramble the styled @hqt_label. Mirrors the window-option setup in new_window. Surfaced by final integration review. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+11
-2
@@ -351,8 +351,10 @@ class TmuxRunner:
|
||||
return None
|
||||
window_id = stdout.strip()
|
||||
|
||||
# Style by window_id: automatic-rename off, the @hqt_label, then the
|
||||
# Frappé per-window theme — one atomic invocation (";" argv separators).
|
||||
# Style by window_id: automatic-rename + allow-rename off (nvim/lazygit
|
||||
# emit OSC title sequences that would otherwise scramble the label), the
|
||||
# @hqt_label, then the Frappé per-window theme — one atomic invocation
|
||||
# (";" argv separators). Mirrors new_window's window-option setup.
|
||||
rc, _, err = await self._exec(
|
||||
"set-option",
|
||||
"-w",
|
||||
@@ -365,6 +367,13 @@ class TmuxRunner:
|
||||
"-w",
|
||||
"-t",
|
||||
window_id,
|
||||
"allow-rename",
|
||||
"off",
|
||||
";",
|
||||
"set-option",
|
||||
"-w",
|
||||
"-t",
|
||||
window_id,
|
||||
"@hqt_label",
|
||||
label,
|
||||
";",
|
||||
|
||||
+3
-1
@@ -1021,7 +1021,7 @@ async def test_new_aux_window_spawns_styles_and_selects(runner):
|
||||
runner._exec.side_effect = [
|
||||
(0, "0\n", ""), # _next_window_index: indices [0] -> next index 1
|
||||
(0, "@7\n", ""), # new-window -P -F '#{window_id}'
|
||||
(0, "", ""), # set-option (automatic-rename + @hqt_label + theme)
|
||||
(0, "", ""), # set-option (automatic-rename + allow-rename + @hqt_label + theme)
|
||||
(0, "", ""), # select-window
|
||||
]
|
||||
wid = await runner.new_aux_window("lazygit", "/proj", ["lazygit"], "lazygit · proj")
|
||||
@@ -1037,6 +1037,8 @@ async def test_new_aux_window_spawns_styles_and_selects(runner):
|
||||
assert calls[2].args[:6] == (
|
||||
"set-option", "-w", "-t", "@7", "automatic-rename", "off",
|
||||
)
|
||||
# allow-rename off too, so nvim/lazygit OSC titles can't scramble the label.
|
||||
assert "allow-rename" in calls[2].args
|
||||
assert "@hqt_label" in calls[2].args
|
||||
assert "lazygit · proj" in calls[2].args
|
||||
assert "remain-on-exit" not in calls[2].args
|
||||
|
||||
Reference in New Issue
Block a user