about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-09-20 01:40:29 +0200
committerbptato <nincsnevem662@gmail.com>2023-09-20 01:40:29 +0200
commit24162bb4dc813f36f411cb262e51169d7d31bc43 (patch)
tree3e64f5125b62c4826e549ce320502ae4303d3a5f
parent2539db24ab3481fd96129650eb2a206e01ab5bfc (diff)
downloadchawan-24162bb4dc813f36f411cb262e51169d7d31bc43.tar.gz
document pager.extern
it's better than nothing, maybe?
-rw-r--r--doc/config.md13
-rw-r--r--todo1
2 files changed, 13 insertions, 1 deletions
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(
 </td>
 </tr>
 
+<tr>
+<td>`pager.extern(cmd, options = {setenv: true, suspend: true, wait: false})`
+</td>
+<td>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.<br>
+Returns true if the command exit successfully, false otherwise.<br>
+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.)</td>
+</tr>
+
 </table>
 
 
diff --git a/todo b/todo
index 37347e1d..4c0098f8 100644
--- a/todo
+++ b/todo
@@ -56,7 +56,6 @@ network:
 - websockets (curl supports ws)
 - integrate curl-impersonate (LD_PRELOAD works, but still...)
 external:
-- something like EXTERN
 - local cgi
 - history, bookmarks (w3m format)
 - save buffer (source, output)