reddit / emacs

progress of emacs-async operations

Tohiko · 2022-11-11 20:26
I am trying to use dired for copying and moving files over `ssh`. Instead of waiting for the operation, I found that I can use `dired-async` from `emacs-async` to make the operation asyncronous. However, now I have no way that indicates progress of copy/move operations. Is there a solution for this? In general, what do people use to indicate progress of processes that emacs spawns?
jackmac79 · 2022-11-11 22:28
I don't think there's a general solution on what you're looking for do you need "progress", or just to be notified when done/on failure?
stsquad · 2022-11-11 23:01
I don't know about dired-async but I know you can see the percentage complete if you use dired-rsync and integrate its mode line data.
Mortal_Scum · 2022-11-12 05:17
I'm not so sure about operations over `ssh`, but in addition to `dired-rsync` there's a great two-parter Emacs package that also uses `rsync` as a backend to provide a convenient pop-up window showing real-time progress of file operations ([tmtxt-async-tasks](https://truongtx.me/tmtxt-async-tasks.html) and [tmtxt-dired-async](https://truongtx.me/tmtxt-dired-async.html)). By default, the pop-up progress window appears at the bottom of the screen and self-terminates once the operation is completed. Knowing that `rsync` usually works well over ssh, there's probably a good way to integrate `ssh` support with this package to get you the sort of functionality you want.
Tohiko · 2022-11-12 10:10
Preferably progress. Notifications should be doable easily I think, by watching the process-list and notifying when a process exits.
Tohiko · 2022-11-12 10:26
tmtxt-async-tasks seem very intersting, I will give it a look. I was thinking of a more general solution that works like `list-processes` or something to show progress and notification of completion. I know "process progress" is very specific to the task but maybe a framework for specifying such progress (especil.
xenodium · 2022-11-12 11:00
[github.com/xenodium/dwim-shell-command](https://github.com/xenodium/dwim-shell-command) may help here: 1. Select dired files 2. `M-x dwim-shell-command` 3. `scp '<<f>>' UserName@TargetHost:TargetPath/` 4. Watch spinner while in progress 5. Do something else if you'd like (it's async in separate process/buffer). 6. Automatically notified when finished. disclosure: I wrote the package
helm05 · 2022-11-12 17:23
Helm provide as well a Rsync command from helm-find-files that replicate the Rsync progress reporter in mode-line.