feat: add terminal dark mode toggle in Settings - #275
Conversation
Add a 'Terminal Dark Mode' switch in the Appearance settings section that renders only the terminal page in dark colors (dark background, light foreground/cursor, dark virtual keys bar) while the rest of the app keeps the light theme. The preference is independent of the app-wide theme.
The termux renderer only paints cell backgrounds; the full-screen default background comes from the View itself. Set the TerminalView background to dark when terminal dark mode is enabled, otherwise the terminal area stays white while only the foreground/cursor colors change.
Change the terminal dark mode foreground/background to pure white (#FFFFFF) on pure black (#000000), matching termux's default scheme instead of the previous grayish text (#E2E2E6) on dark gray background (#121212).
Use Compose's Color.White / Color.Black constants instead of the Android android.graphics.Color.WHITE/BLACK uppercase aliases.
|
Poor terminal-font readability under light mode is a pre-existing bug. For instance, it occurs occasionally while using nano. That is why I implemented this terminal dark-mode option. I will attempt to fix the font-color issue for light mode. |
|
I tracked it down and pushed a fix to the branch. Root cause: the PR always overrode the default background color and painted the TerminalView background, even in light mode. Now light mode keeps the previous behavior — the Activity background shows through and the default background stays as-is. Those overrides only run when "Terminal Dark Mode" is enabled. |
Thank you. It's fixed now. |

Summary
Adds a "Terminal Dark Mode" toggle in the Appearance section of Settings. When enabled, only the terminal page renders in dark colors (pure white text on a black background, classic termux scheme) while the rest of the app keeps the light theme. When disabled, the terminal follows the app theme as before.
Motivation
On light-themed setups the terminal area used theme-derived colors that could be hard to read, and there was no way to force a dark terminal independently of the app-wide theme. This lets users keep a light UI everywhere else while still getting a high-contrast dark terminal.
Changes Made
Constants.kt: addedKEY_TERMINAL_DARK_THEMEpreference keyPreferencesManager.kt: addedterminalDarkThemeproperty (defaultfalse)SettingsScreen.kt: added a "Terminal Dark Mode" switch under AppearanceContainerTerminalScreen.kt:#FFFFFF) and background to pure black (#000000) via the termuxTerminalColorsindices (256/257/258)TerminalViewview background directly, since the termux renderer only paints cell backgrounds and the full-screen default background comes from the View itselfStrings
Added
terminal_dark_theme/terminal_dark_theme_descriptionto the default (English) and Simplified Chinese string resources.Testing
Verified on a Xiaomi tablet: enabling the toggle turns only the terminal page dark (white on black) while the rest of the app stays light; disabling it restores the previous behavior.