Repository navigation
Conversation
At startup the manager asks the host terminal for colors 0 to 15 with OSC 4, one query per color and a closing device attributes request in a single write, within the existing terminal query deadline. The answered colors go into tmux's pane-colours, so an agent that asks a pane for one of them gets the color the host draws it in. A color the host leaves unanswered stays unset. pane-colours arrived in tmux 3.3. set-option -q skips it on 3.1 and 3.2, so session creation keeps working there.
…rop what is left A host that starts answering the OSC 4 queries before the 200 ms deadline but finishes after it (tmux 3.6 holds the device attributes reply behind a forwarded color for up to 500 ms, a slow link delivers the rest late) left its remaining replies on the tty, where Bubble Tea read them as alt+] and a run of runes typed into whatever input had focus. Once any reply has arrived the read now waits for the device attributes reply for up to a second, and the tty's unread input is flushed before the TUI takes over. A silent host still costs only the deadline.
…ng c A reply file read while tmux was midway through rgb:cccc/... also ended in c, so the palette query test could compare a cut-off reply. The skip on psmux now states only what is known: it has no pane-colours option. The Palette and QueryPalette docs say what an unopenable tty and Windows do.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What changed
pane-coloursnext towindow-style, so a pane that asks for color 1 gets the color the host draws it in. A color the host leaves unanswered (mosh, terminals without OSC 4 replies) stays unset. The array is cleared before each write, so it holds only the current host's answers.pane-coloursarrived in tmux 3.3.set-option -qskips it on 3.1 and 3.2, the same wayextended-keysis set today, so session creation keeps working there.What a pane gets back depends on its tmux:
On Windows the host is not queried, so psmux gets no
pane-colours.How it was verified
printf '\e]4;1;?\a'in a managed pane got\e]4;1;rgb:cccc/2424/1d1d\a, and colors 4 and 15 matched as well. Color 2, which the host left unanswered, got no reply. The same run on main got no OSC 4 reply at all. A host that answers no OSC 4 leftpane-coloursempty and cleared a value an earlier run had set. Captured rows keep their color indexes (capture-pane -estill shows\e[31m).go test -race ./...,go vet ./..., staticcheck, gofmt and the architecture checks pass.Closes #684