You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It appears that this library is currently unable to query GNU Screen and tmux terminals for their foreground & background colors, but I would like it to be able to do so. According to the source code for the termbg Rust library, a Screen terminal can be queried for its background color with the sequence "\x1bP\x1b]11;?\x07\x1b\\\x03"; I can confirm this works as of Screen 4.9.1, and I can also confirm that the foreground color can be queried by changing the 11 in the background query to a 10. In addition, the sequence that termenv uses for querying the cursor position ("\x1b[6n") also works with Screen.
termbg also uses the sequence "\x1bPtmux;\x1b\x1b]11;?\x07\x1b\\\x03" for getting the background color for tmux terminals. I don't have tmux, so I can't test it, but this sequence does work with my copy of Screen.
The text was updated successfully, but these errors were encountered:
Passthroughs silently fail on tmux since 3.3 unless they're specifically enabled. That said, tmux now allows foreground and background queries without passthrough, not sure when that started.
I believe the issue with screen that caused it to be disabled is that the cursor position query is something screen is able to field itself, resulting in the responses sometimes arriving out of order (they issue the passthrough color request, screen passes it along, they issue the cursor request, screen replies immediately, the color reply comes back and screen passes it along). If this happens, it's not just a matter of the color being mistaken, the color reply will be stuck in the pipe and can cause problems.
It looks like tmux has had the ability to respond to these queries since 3.2a, but depending on what the color was, it just sometimes... wouldn't. Starting in 3.4, it is guaranteed to respond (though it may sometimes provide an incorrect color), and it precaches the response on startup, so it won't have the screen issue where the values may arrive out of order.
It seems like it should be 100% safe to allow tmux to respond.
It appears that this library is currently unable to query GNU Screen and tmux terminals for their foreground & background colors, but I would like it to be able to do so. According to the source code for the
termbg
Rust library, a Screen terminal can be queried for its background color with the sequence"\x1bP\x1b]11;?\x07\x1b\\\x03"
; I can confirm this works as of Screen 4.9.1, and I can also confirm that the foreground color can be queried by changing the11
in the background query to a10
. In addition, the sequence thattermenv
uses for querying the cursor position ("\x1b[6n"
) also works with Screen.termbg
also uses the sequence"\x1bPtmux;\x1b\x1b]11;?\x07\x1b\\\x03"
for getting the background color for tmux terminals. I don't have tmux, so I can't test it, but this sequence does work with my copy of Screen.The text was updated successfully, but these errors were encountered: