Skip to content
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

Terminal reports incorrect background color when queried with OSC 11 #10121

Open
bash opened this issue Dec 27, 2024 · 0 comments
Open

Terminal reports incorrect background color when queried with OSC 11 #10121

bash opened this issue Dec 27, 2024 · 0 comments

Comments

@bash
Copy link

bash commented Dec 27, 2024

Tabby version: 1.0.216 (latest)

Description

When querying the terminal for its background color using the OSC 11 sequence it always reports black (^[]11;rgb:0000/0000/0000^[\) instead of the actual background color.

This is an issue especially in light mode as it breaks tools that try to detect dark/light mode based on the terminal's background color.

Some tools that rely on this: delta, run0 (systemd), and bat.

Steps to reproduce

  • (Ensure that the config is set to its defaults)
  • Enable light mode (Settings -> Color Scheme -> Always Light)
  • Run printf '\x1b]11;?\e\\' && cat -v

Observe that the printed color is black instead of white (or a light gray).

Notes

  • The foreground color (OSC 10) is reported accurately.
  • The issue occurs with both the xterm (WebGL) and the xterm (canvas) frontend.
  • From a quick glance: The issue seems to arise from the fact that the background passed to xterm.js (which in turn answers the OSC queries) is sometimes black instead of the actual color:
    background: getTerminalBackgroundColor(this.configService, this.themes, scheme) ?? '#00000000',
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants