sxyazi / yazi

💥 Blazing fast terminal file manager written in Rust, based on async I/O.
https://yazi-rs.github.io
MIT License
11.42k stars 266 forks source link

Detach tasks user launched tasks #1218

Closed Lcchy closed 4 days ago

Lcchy commented 4 days ago

Please describe the problem you're trying to solve

Hi, thanks a lot for the amazing file manager, I use it every day.

When using yazi, I often open a file, e.g. an image in an image viewer, and then want to quit yazi.

When quitting, yazi prompts me to confirm as there is a task running, I would like to not have this prompt.

Would you be willing to contribute this feature?

Describe the solution you'd like

I understand the necessity of the prompt for data sensitive operations like cp, mv etc.

Would it be possible to detach all user started tasks from the terminal (e.g. nohup) in order to be able to close yazi without a prompt ? The processes could still be tracked/managed in the task view.

If this is not something desirable by default, would there be a way to modify the task spawning in the configuration ? Or could it be done with a plugin ?

Additional context

No response

sxyazi commented 4 days ago

Set orphan = true for your opener rule:

orphan: Keep the process running even if Yazi has exited, once specified, the process will be detached from the task scheduling system.

BTW, the shell command also has a --orphan option available.

Closing as already supported

Lcchy commented 3 days ago

Oh I see! Thanks a lot!

Sorry for the noise, I thought I looked at all the docs but I missed this.