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
Consider true-color detection option, set rgb then inquire result.
Querying The Terminal
In an interactive program that can read terminal responses, a more reliable method is available, that is transparent to sudo & ssh.
Simply try sending a truecolor value to the terminal, followed by a query to ask what color it currently has. If the response indicates the same color as was just set, then truecolor is supported.
If the response indicates an 8-bit color, or does not indicate a color, or if no response is forthcoming within a few centiseconds, then assume that truecolor is not supported.
Here we set the background color to RGB(1,2,3) - an unlikely default choice - and request the value that we just set. The response comes back that the request was understood (1), and that the color is indeed 48:2:1:2:3. This tells us also that the terminal supports the colon delimiter. If instead, the terminal did not support truecolor we might see a response like
This terminal did not even understand the DECRQSS request - its response was CSI+0$r. This does not indicate whether it set the color, but since it doesn't understand how to reply to our request it is unlikely to support truecolor either.
The text was updated successfully, but these errors were encountered:
Consider true-color detection option, set rgb then inquire result.
Querying The Terminal
In an interactive program that can read terminal responses, a more reliable method is available, that is transparent to sudo & ssh.
Simply try sending a truecolor value to the terminal, followed by a query to ask what color it currently has. If the response indicates the same color as was just set, then truecolor is supported.
If the response indicates an 8-bit color, or does not indicate a color, or if no response is forthcoming within a few centiseconds, then assume that truecolor is not supported.
Here we set the background color to RGB(1,2,3) - an unlikely default choice - and request the value that we just set. The response comes back that the request was understood (1), and that the color is indeed 48:2:1:2:3. This tells us also that the terminal supports the colon delimiter. If instead, the terminal did not support truecolor we might see a response like
This terminal replied that the color is 40 - it has not accepted our request to set 48:2:1:2:3.
This terminal did not even understand the DECRQSS request - its response was CSI+0$r. This does not indicate whether it set the color, but since it doesn't understand how to reply to our request it is unlikely to support truecolor either.
The text was updated successfully, but these errors were encountered: