From a42e660627fe5715f6f4d5a9215394baec775726 Mon Sep 17 00:00:00 2001 From: bptato Date: Sun, 27 Oct 2024 22:33:21 +0100 Subject: pager: misc extern fixes * fix externFilterSource ignoring content types other than html * refactor runProcess to use a custom fork/exec instead of system(3) --- doc/api.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'doc') diff --git a/doc/api.md b/doc/api.md index ec41f390..54bfb7d6 100644 --- a/doc/api.md +++ b/doc/api.md @@ -255,12 +255,14 @@ Like `pager.ask`, but the return value is a character. -`extern(cmd, options = {setenv: true, suspend: true, wait: false})` +`extern(cmd, options = {env: { ... }, suspend: true, wait: false})` -Run an external command `cmd`. The `$CHA_URL` and `$CHA_CHARSET` variables -are set when `options.setenv` is true. `options.suspend` suspends the pager -while the command is being executed, and `options.wait` makes it so the user -must press a key before the pager is resumed.
+Run an external command `cmd`.
+By default, the `$CHA_URL` and `$CHA_CHARSET` variables are set; change +this using the `env` option.
+`options.suspend` suspends the pager while the command is being +executed, and `options.wait` makes it so the user must press a key +before the pager is resumed.
Returns true if the command exit successfully, false otherwise.
Warning: this has a bug where the output is written to stdout even if suspend is true. Redirect to /dev/null in the command if this is not desired. (This -- cgit