From fcd7e8768dc4a23f6e4f1aec57c9d2236ebe7fae Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Sun, 19 Mar 2023 15:42:47 +0900 Subject: Omit port number in `--listen` for automatic port assignment Close #3200 --- man/man1/fzf.1 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'man') 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" -- cgit v1.2.3