Skip to content

fix: only apply background overrides in terminal dark mode - #276

Merged
ravindu644 merged 6 commits into
ravindu644:devfrom
Yizhou147:feat-terminal-dark-mode
Aug 11, 2026
Merged

fix: only apply background overrides in terminal dark mode#276
ravindu644 merged 6 commits into
ravindu644:devfrom
Yizhou147:feat-terminal-dark-mode

Conversation

@Yizhou147

Copy link
Copy Markdown
Contributor

Summary

Fixes the light-mode terminal rendering regression reported after #275 was merged. In light mode the terminal font/background now renders exactly as it did before the dark-mode feature was introduced.

Root cause

#275 set the TerminalView background and the default background color (index 257) unconditionally, deriving them from the Material theme surface color. In light mode this changed the previous behavior, where the Activity background shows through the TerminalView and the terminal’s default background is left untouched — which caused broken font rendering on some devices.

Fix

The full-screen background paint (setBackgroundColor) and the default background color override are now only applied when "Terminal Dark Mode" is enabled. Light mode keeps the exact pre-#275 behavior.

Changes

  • ContainerTerminalScreen.kt: gate background overrides behind the terminalDarkTheme preference.

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.
Light mode now keeps the pre-PR behavior: the Activity background shows
through the TerminalView and the default background color is left untouched.
The full-screen background paint and the default-background override only
apply when "Terminal Dark Mode" is enabled.
@ravindu644
ravindu644 changed the base branch from main to dev August 11, 2026 03:54
@ravindu644
ravindu644 merged commit 3470336 into ravindu644:dev Aug 11, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants