JakeWharton / mosaic

Build terminal UI in Kotlin using Jetpack Compose
Apache License 2.0
1.92k stars 57 forks source link

Light/dark detection #396

Open JakeWharton opened 5 months ago

JakeWharton commented 5 months ago

Port techniques from https://github.com/dalance/termbg. Expose as CompositionLocal.

EpicDima commented 2 months ago

I looked at the implementation, for support we need at least getting the value of the environment variable, which is platform-specific. This is enough for partial functionality. For full functionality, we need to support getting color from xterm, which is done via

  1. By enabling raw mode
  2. Sending a command via stderr
  3. Receiving the command response via stdin