You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support integration with xplr by allowing to print paths selected for deletion #87
Hi, Nice tool. I have added an integration hack with xplr.
However, for better integration experience, is there a way to print the selected paths? This would allow migration of the dua-cli selected paths to xplr selection.
changed the title [-]Improve integration with `xplr` by allowing to print selected paths[/-][+]Support integration with `xplr` by allowing to print paths selected for deletion[/+]on Apr 16, 2021
Maybe a command line option, something like -p PATH (for pipe) can be implemented. -p /tmp/list.txt will pipe the paths to /tmp/list.txt, while -p - will print them to stdout.
This should be resolved with dua v2.13, where dua i unconditionally prints remaining marked items. This should be fine as the default workflow usually is to mark and delete, leaving no items in the pane. If somebody leaves them it's either because the wanted to, or because they quit by mistake. In the latter case it's probably desirable to have the paths 'memorized' in the terminal in case they want to try again.
Only for the users who quit intentionally (maybe because they changed their mind) will the new behaviour be surprising as they now see selected paths that they never care about. Lastly, in case deletion fails due to permission errors for instance, paths will be printed as well as they would remain in the pane. For these users it might also be interesting to see them as they can try again by hand with sudo.
This is the reasoning for printing remaining paths by default, currently without a way to turn that off.
➜ ~ dua i | xargs -l 'echo SelectPath: "{}"'
Error: Interactive mode requires a connected terminal
xargs: echo SelectPath: "{}": No such file or directory
➜ ~ paths=$(dua i)
Error: Interactive mode requires a connected terminal
➜ ~ dua i > x
Error: Interactive mode requires a connected terminal
Activity
[-]Better integration[/-][+]Improve integration with `xplr` by allowing to print selected paths[/+]Byron commentedon Apr 15, 2021
Nice indeed, thanks!
Do you mean it would be nice to print paths selected for deletion upon quitting
dua?sayanarijit commentedon Apr 15, 2021
Yes. Instead of deleting, it can return the paths via stdout, and then other tools can decide what to do with them.
[-]Improve integration with `xplr` by allowing to print selected paths[/-][+]Support integration with `xplr` by allowing to print paths selected for deletion[/+]sayanarijit commentedon Jun 7, 2021
Maybe a command line option, something like
-p PATH(for pipe) can be implemented.-p /tmp/list.txtwill pipe the paths to/tmp/list.txt, while-p -will print them to stdout.Byron commentedon Jun 8, 2021
This should be resolved with
dua v2.13, wheredua iunconditionally prints remaining marked items. This should be fine as the default workflow usually is to mark and delete, leaving no items in the pane. If somebody leaves them it's either because the wanted to, or because they quit by mistake. In the latter case it's probably desirable to have the paths 'memorized' in the terminal in case they want to try again.Only for the users who quit intentionally (maybe because they changed their mind) will the new behaviour be surprising as they now see selected paths that they never care about. Lastly, in case deletion fails due to permission errors for instance, paths will be printed as well as they would remain in the pane. For these users it might also be interesting to see them as they can try again by hand with
sudo.This is the reasoning for printing remaining paths by default, currently without a way to turn that off.
sayanarijit commentedon Jun 8, 2021
Thanks a lot. Really well thought out and creative solution 👍
sayanarijit commentedon Jun 9, 2021
Hi, I tried integrating, but there's some issue.
Byron commentedon Jun 9, 2021
A great point, sorry for the oversight.
In version 2.13.1 it's implemented so that the TUI wants to write to stderr, allowing the redirections of stdout to catch the selected files.
I hope this works now :).
sayanarijit commentedon Jun 9, 2021
Works now. Thanks.