Automatic switching between light and dark theme (CSI 2031)
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 40.5k
- Forks
- 2.3k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 79
Description
Related problem
Currently, nushell does not have support for switching between dark and light theme - there is always only one color theme configured in $env.config.color_config.
Several terminals (Ghostty, Contour, Kitty) have implemented support for CSI 2031 https://github.com/contour-terminal/contour/blob/f3c3334aa5c861348c5bbe8ffe572c872eef2e08/docs/vt-extensions/color-palette-update-notifications.md which allows terminal applications to receive updates regarding the current system theme, and then automatically switch between light/dark theme.
It would be nice if nushell had support for this.
Describe the solution you'd like
- Refactor current color theme configuration
$env.config.color_configto support light and dark theme, e.g.:
env.config.color_theme = "light"
env.config.color_theme_light = ...
env.config.color_theme_dark = ...
- Implement support for CSI 2031 https://github.com/contour-terminal/contour/blob/f3c3334aa5c861348c5bbe8ffe572c872eef2e08/docs/vt-extensions/color-palette-update-notifications.md to receive information about current system theme.
Describe alternatives you've considered
No response
Additional context and details
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files, tests, or entry points are named. Start by locating the implementation of $env.config.color_config and the terminal input handling relevant to CSI 2031. Done means light and dark theme configuration is supported and Nushell can receive CSI 2031 notifications to switch themes automatically.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100