Skip to content

terminal: Implement dark/light mode detection (DECSET 2031) #15

@coletrammer

Description

@coletrammer

Summary

Some terminals and some applications (including Neovim 0.11+) support querying whether the system is in dark mode or light mode. We will rely on the outer terminal for this information, so we're just passing it through.

The spec supports both explicit queries (via DECRQM 996) and unsolicited updates (DEC mode 2031). ttx will enable DEC mode 2031 on the outer terminal in order to emulate both these features.

When there are multiple clients connected to the same server, its possible that clients can have different values for these modes. In general, we'll need some way to know which client is most recently active (probably will use focus events), to determine what to report.

Spec: https://contour-terminal.org/vt-extensions/color-palette-update-notifications/

Progress

  • Implement host querying
  • Implement forwarding to application
  • Add tests

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestterminalRelated to terminal emulation

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions