Open mentalisttraceur opened 1 year ago
Next version will export $TERMUX__PACKAGE_NAME
variable for the app package in which the shell is running, different from $TERMUX_APP__PACKAGE_NAME
for the core app. However, Termux:Float is eventually going to be integrated into Termux app itself so would require an API to check current status, including fullscreen mode, etc.
However, Termux:Float is eventually going to be integrated into Termux app itself
Will we still be able to have both a normal terminal and a floating terminal open at the same time? And two separate shortcuts on the home screen, one for the floating terminal and one for the normal terminal?
I haven't really thought much of the design but supporting both at same time would complicate things a lot, but might be possible, will see what can be done. It won't happen anytime soon anyways, much higher priority things to work on in coming months.
I also would like to run some code only in Termux:Float. I thought I had a solution by putting this in my bashrc:
if [ "$(pwd)" = "$HOME/.termux/termux_float" ]; then
echo "In termux float"
fi
And setting:
default-working-directory = ~/.termux/termux_float/
in ~/.termux/termux.float.properties
I think this should work, however I can't get default-working-directory
to change the directory in either termux.float.properties or termux.properties. I've run termux-reload-settings and checked that my bashrc and profile files aren't changing the directory. Any ideas?
For whatever it's worth, I no longer have any foreseeable use for this part:
Will we still be able to have both a normal terminal and a floating terminal open at the same time? And two separate shortcuts on the home screen, one for the floating terminal and one for the normal terminal?
default-working-directory = ~/.termux/termux_float/
The ~/
in path won't be expanded and an error in logcat will be logged. Use absolute path /data/data/com.termux/files/home/
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:
Have Termux's floating app export an additional environment variable, for example
TERMUX_FLOAT
, before starting the user's shell.Add a program to
termux-api
, for exampletermux-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:
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.
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.