From 82ff8fcdf5807143302fbc42903eb08044b79f1f Mon Sep 17 00:00:00 2001 From: sxyazi Date: Sat, 27 Apr 2024 16:26:22 +0800 Subject: [PATCH] docs: add `--orphan` option to `run` command and `wait_with_output` method --- docs/configuration/keymap.md | 3 ++- docs/plugins/utils.md | 11 +++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/configuration/keymap.md b/docs/configuration/keymap.md index 3028018e..fe37c65b 100644 --- a/docs/configuration/keymap.md +++ b/docs/configuration/keymap.md @@ -278,8 +278,9 @@ Run a shell command. | Argument/Option | Description | | --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `[run]` | Optional, command template to be run. | -| `--block` | Open in a blocking manner. After setting this, Yazi will hide into a secondary screen and display the program on the main screen until it exits. During this time, it can receive I/O signals, which is useful for interactive programs. | | `--confirm` | When the template is provided, run it directly, no input UI was shown. | +| `--block` | Open in a blocking manner. After setting this, Yazi will hide into a secondary screen and display the program on the main screen until it exits. During this time, it can receive I/O signals, which is useful for interactive programs. | +| `--orphan` | Keep the process running even if Yazi has exited, once specified, the process will be detached from the task scheduling system. | You can use the following shell variables in `[run]`: diff --git a/docs/plugins/utils.md b/docs/plugins/utils.md index ecf94ba7..771c7bb6 100644 --- a/docs/plugins/utils.md +++ b/docs/plugins/utils.md @@ -635,6 +635,17 @@ Wait for the child process to finish, returns `(status, err)`: - `status` - The [Status](#status) of the child process if successful; otherwise, `nil` - `err` - The error code if the operation is failed, which is an integer if any +### `wait_with_output()` {#Child.wait_with_output} + +```lua +local output, err = child:wait_with_output() +``` + +Wait for the child process to finish and get the output, returns `(output, err)`: + +- `output` - The [Output](#output) of the child process if successful; otherwise, `nil` +- `err` - The error code if the operation is failed, which is an integer if any + ### `start_kill()` {#Child.start_kill} ```lua