-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: termux-open does not seem to work with Android 13 (should it?) #3565
Comments
Have you enabled |
Yes. I tried that, although I don't really understand what it does. However, I'm not sure whether something needs to be restarted to make that setting take effect; and, if so, what. I also added the permission for Termux to be able to raise apps from a background service, which I think is a new requirement in Android 11. However, I'm not sure that Termux actually does that. What I'm baffled about is how termux-open is supposed to work, and where files can be stored in order for it to work. The script runs 'am broadcast -n com.termux....' which suggests to me that the Intent is supposed to be handled by the Termux app, rather than some other app. So, when I see a chooser dialog, I don't know whether that's the result of something that Termux does, or whether something in Android is intercepting the Intent and raising the chooser (I don't see why it would). I also don't really understand where termux-open can read files from. It uses For example, if I do
to read from a plug-in SD card, maybe Termux can't actually see that path, because of permissions restrictions? But Linux commands in Termux can see the file perfectly well, so I'm not sure that's an explanation. My main question, though, is about Intent handling. If (for some reason), I see a chooser dialog when I run |
It is currently a unified property to allow external apps to access termux data. Either run https://github.com/termux/termux-tasker#allow-external-apps-property-optional
The
The As for errors, it's the responsibility of receiver apps to show you proper errors for why they failed to open something. You can also check
If you select Termux in chooser screen, the file will be sent to |
Hi. Thank you for the detailed response. I'm aware that the handling of So here are my observations.
So in summary:
Is this broadly in line with what other people have found (for the latest Android versions)? From the perspective of a Linux developer, Android file management sucks, and it's sucking harder with each new Android release. I'm certainly not blaming Termux for that. BTW none of this is a show-stopper. BW |
If some apps are working from external storage and some not, then that would likely be an issue with target app, not with termux. You can check with
I can add
This is weird, do you use same file name when copying? The mime type is generated based on file extension, if there is no valid extension, chooser apps won't show. You can try passing If something is broken on termux end for external storage, then it should be fixed. |
Thanks. It never occurred to me that logcat would produce different output as root. I will try that if I continue to have problems. But... Since I rebooted my tablet, most of the weird behaviour has gone away. Even the built-in gallery app, which was previously showing a blank page, is now showing pictures. I'm getting offered apps that correspond to the correct file types -- I suspect that failures in this area were the result of a bug in LineageOS: there are some bugs logged in this area. So the only outstanding issues are
I unerstand that both of these would need code changes. It would nice if this were done at some point, but there's no urgency at all. |
Write access should be easy enough, but will require updating The |
I'm happy to close this, and raise new enhancement requests for the write access and /storage issues -- I guess these aren't bugs, but just the way it works. Up to you. |
It's fine, keep this open. I have added them to the my todo list. |
|
Problem description
termux-open
does not seem to work at all, in any of the many ways I have tried it, on my S5E tablet with Android 13. I'm aware that it's always been somewhat problematic, to make termux interact properly with graphical Android apps, owing to all the various security restrictions. However, I'm unsure whether it's even expected to work with Android 13.When I run
termux-open file
, what generally happens is that a chooser window pops up (even if I don't use the-chooser
switch). One of the choices is always 'Termux', the other usually an app that can handle the file. I don't really even know what I'm supposed to select at this point.If I choose 'Termux', I see an error pop-up dialog from
TermuxFileReceiver
saying that the file is invalid. If I choose an ordinary app, it generally starts, but then either displays a blank page or an error message of some kind -- depending on the file type.I've tried with files that are in the Termux home directory, absolute paths to files in the termux home directory, absolute paths to files in /storage, and file:/// URLs. The results differ according to where the file is, but the result is never that any file gets opened.
To be honest, I really have no idea how
termux-open
is supposed to work, so it's hard to troubleshoot.Steps to reproduce the behavior.
On an Android 13 device, try to open a file using
termux-open
.What is the expected behavior?
I would expect an app that can handle the file to launch, and show the file.
System information
The text was updated successfully, but these errors were encountered: