Skip to content

Commit

Permalink
Add --listen=HTTP_PORT option to receive actions
Browse files Browse the repository at this point in the history
Supersedes #2019

See also:
* #1728
* junegunn/fzf.vim#1044
  • Loading branch information
junegunn committed Dec 20, 2022
1 parent 51c518d commit 1ba7484
Show file tree
Hide file tree
Showing 5 changed files with 337 additions and 249 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ CHANGELOG

0.36.0
------
- Added `--listen=HTTP_PORT` option to receive actions from external processes
```sh
# Start HTTP server on port 6266
fzf --listen 6266

# Send actions to the server
curl -XPOST localhost:6266 -d 'reload(seq 100)+change-prompt(hundred> )'
```
- Added `next-selected` and `prev-selected` actions to move between selected
items
```sh
Expand Down
13 changes: 13 additions & 0 deletions man/man1/fzf.1
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,19 @@ ncurses finder only after the input stream is complete.
e.g. \fBfzf --multi | fzf --sync\fR
.RE
.TP
.B "--listen=HTTP_PORT"
Start HTTP server on the given port to receive actions via POST requests.

e.g.
\fB# Start HTTP server on port 6266
fzf --listen 6266

# Send action to the server
curl -XPOST localhost:6266 -d 'reload(seq 100)+change-prompt(hundred> )'
\fR

The port number is exported as \fB$FZF_LISTEN_PORT\fR on the child processes.
.TP
.B "--version"
Display version information and exit

Expand Down
Loading

0 comments on commit 1ba7484

Please sign in to comment.