Skip to content

Provide a way to detect if inside floating Termux #51

@mentalisttraceur

Description

@mentalisttraceur

Feature Description

I want a way for scripts/programs in Termux to detect if the current terminal is shown in the floating Termux window.

Couple possible ways, doesn't matter to me which:

  1. Have Termux's floating app export an additional environment variable, for example TERMUX_FLOAT, before starting the user's shell.

  2. Add a program to termux-api, for example termux-api-in-floating-window, which could for example report the value as the exit status.

Why

I use both Termux and Termux:Float, and they have different roles in my workflow. It would help me make my tools automatically do what I want if I could code them to know which of the two they're in.

Current Alternatives

I can think of two currently possible ways to get close to this:

  1. Manually running a command when I start Termux:Float, which would set up some indicator that I'm in a floating window, but that's an extra manual step every time, and not exactly reliable if I forget.

  2. Checking the terminal size, but that's really not reliable if I resize the terminal, change Termux font size, or use something like a terminal multiplexer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions