Terminal apps cause interactive session to effectively hang
While this is potentially more of an issue with xdg-open1 than dua, other TUI applications are able to handle this better (e.g. yazi).
My default editor is helix and my default file browser is yazi, both of which have .desktop files which indicate they are terminal applications. Currently, xdg-open will attempt to open terminal based applications using the same terminal it was called from, effectively attempting to take over the current terminal from dua, and while it appears as though the key presses are going through to the spawned app (i.e. q will exit yazi), the terminal window only displays the dua TUI.
Here's a demonstration of the issue that captures running instances of hx and yazi as well as displaying key presses:
https://github.com/user-attachments/assets/c76722cd-15c4-4ad4-a510-f2d1ec634574
Thanks a lot for reporting!
Indeed, the open crate is used to open paths and I never had an idea that this could spawn an application in the same terminal. Thus, I do not have any idea of what would need to be done to improve this.
On the bright side, helix can already do it and their codebase might hold the answer.
Looks like gitgui implemented a solution like so: https://github.com/gitui-org/gitui/commit/ce4f3af767574fdda07484d6cc6c2236cfb24302
I can't see yazi or helix doing similar, except on exit, so not sure how it's working there.
It may be simpler than that, it could be that open-rs isn't allowing the process to inherit stdout/stderr.
It does inherit everything by default, but when executing it it will disable all output.
Maybe it would work better without doing that, assuming that the launcher doesn't output anything to stderr/stdout.