m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-16 15:23:48 -05:00

Add Unix domain socket support for --listen

Close #4541
This commit is contained in:
Junegunn Choi
2025-10-09 01:05:26 +09:00
parent c38c6cad79
commit 01cb38a5fb
5 changed files with 87 additions and 26 deletions

View File

@@ -1268,7 +1268,9 @@ func NewTerminal(opts *Options, eventBox *util.EventBox, executor *util.Executor
return nil, err
}
t.listener = listener
t.listenPort = &port
if port > 0 {
t.listenPort = &port
}
}
if t.hasStartActions {
@@ -1292,6 +1294,9 @@ func (t *Terminal) environForPreview() []string {
func (t *Terminal) environImpl(forPreview bool) []string {
env := os.Environ()
if t.listenAddr != nil && len(t.listenAddr.sock) > 0 {
env = append(env, "FZF_SOCK="+t.listenAddr.sock)
}
if t.listenPort != nil {
env = append(env, fmt.Sprintf("FZF_PORT=%d", *t.listenPort))
}