这是indexloc提供的服务,不要输入任何密码
Skip to content

[Bug]: Background color not respected when started with scripts #4849

@groszdaniel

Description

@groszdaniel

Problem description

If Termux is launched in certain ways — from a shortcut from termux-widget, or via a termux-url-opener hook —, it does not respect the background color specified in ~/.termux/colors.properties, and starts with a black background. Weirdly, it does respect the foreground color, so if I use a black-on-white style, the script's output is invisible.

Steps to reproduce the behavior.

Choose a color scheme that has a background color other than black, particularly a light scheme.

Put a script in ~/.shortcuts. Put the Termux widget on the home screen. Launch the script from the widget.

The bug is only reproduced if there's no Termux session already running. It also doesn't manifest when launching Termux via its normal app icon.
The bug happens most of the time under these conditions, but not always.
Also, while the terminal initially has a black background when this happens, if I switch to another app and back, or even just open the app switcher (Recents screen) and go back to Termux, it then gets the correct background.

What is the expected behavior?

The background is as specified in the color scheme, e.g. light if it's a light scheme.

System information

  • Termux application version: 0.118.3 (1002)
  • Android OS version: crDroid 10.13, based on Android 14
  • Device model: Xiaomi Redmi 9C NFC

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions