From 24162bb4dc813f36f411cb262e51169d7d31bc43 Mon Sep 17 00:00:00 2001 From: bptato Date: Wed, 20 Sep 2023 01:40:29 +0200 Subject: document pager.extern it's better than nothing, maybe? --- doc/config.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'doc/config.md') diff --git a/doc/config.md b/doc/config.md index 114a8152..029f9a8a 100644 --- a/doc/config.md +++ b/doc/config.md @@ -882,6 +882,19 @@ q = 'pager.ask("Do you want to exit Chawan?").then(x => x ? pager.quit() : void( + +`pager.extern(cmd, options = {setenv: true, 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.
+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 +will be fixed in the future.) + + -- cgit 1.4.1-2-gfad0