summaryrefslogtreecommitdiffstats
path: root/man
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2023-03-19 15:42:47 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2023-03-19 15:48:39 +0900
commitfcd7e8768dc4a23f6e4f1aec57c9d2236ebe7fae (patch)
tree7d39262b031120ceebf516a0e844b4ac26766edd /man
parent3c34dd82750ca61a1ee7f329ed47fe01e6d1ee30 (diff)
Omit port number in `--listen` for automatic port assignment
Close #3200
Diffstat (limited to 'man')
-rw-r--r--man/man1/fzf.110
1 files changed, 8 insertions, 2 deletions
diff --git a/man/man1/fzf.1 b/man/man1/fzf.1
index 6d6d49bd..a538a91c 100644
--- a/man/man1/fzf.1
+++ b/man/man1/fzf.1
@@ -738,9 +738,12 @@ ncurses finder only after the input stream is complete.
e.g. \fBfzf --multi | fzf --sync\fR
.RE
.TP
-.B "--listen=HTTP_PORT"
+.B "--listen[=HTTP_PORT]"
Start HTTP server on the given port. It allows external processes to send
-actions to perform via POST method.
+actions to perform via POST method. If the port number is omitted or given as
+0, fzf will choose the port automatically and export it as \fBFZF_PORT\fR
+environment variable to the child processes started via \fBexecute\fR and
+\fBexecute-silent\fR actions.
e.g.
\fB# Start HTTP server on port 6266
@@ -748,6 +751,9 @@ e.g.
# Send action to the server
curl -XPOST localhost:6266 -d 'reload(seq 100)+change-prompt(hundred> )'
+
+ # Choose port automatically and export it as $FZF_PORT to the child process
+ fzf --listen --bind 'start:execute-silent:echo $FZF_PORT > /tmp/fzf-port'
\fR
.TP
.B "--version"