#2660·lf

config-time lf -remote "send $id ..." sometimes gets dropped at startup

Author: ooobambooCreated Aug 9, 2026Updated Aug 9, 2026

I followed the wiki's env-var pattern in my lfrc:

cmd eval &{{
    cmd="send $id"
    for arg; do
        cmd="$cmd $(eval "printf '%s' \"$arg\"" | sed 's/\\/\\\\/g;s/ /\\ /g;s/"/\\"/g')"
    done
    lf -remote "$cmd"
}}
eval set previewer "$XDG_CONFIG_HOME/lf/previewer"

Same config, two runs with lf -log:

Fails — server not up yet, command never reaches the client:

2026/08/09 18:24:50 loading clipboard: []
2026/08/09 18:24:50 reading file: /home/seriola/.config/lf/lfrc
2026/08/09 18:24:50 shell-async: &{{ cmd="send $id" ... }} -- [set previewer $XDG_CONFIG_HOME/lf/previewer]
2026/08/09 18:24:50 connecting server: dial unix /run/user/1000/lf.sock: connect: no such file or directory
2026/08/09 18:24:50 listFilesInCurrDir(): /home/seriola is still loading, `files` isn't ready for remote query
2026/08/09 18:24:50 loading clipboard: []

Works:

2026/08/09 18:24:54 loading clipboard: []
2026/08/09 18:24:54 reading file: /home/seriola/.config/lf/lfrc
2026/08/09 18:24:54 shell-async: &{{ cmd="send $id" ... }} -- [set previewer $XDG_CONFIG_HOME/lf/previewer]
2026/08/09 18:24:54 listFilesInCurrDir(): /home/seriola is still loading, `files` isn't ready for remote query
2026/08/09 18:24:54 loading clipboard: []
2026/08/09 18:24:54 recv: set previewer /home/seriola/.config/lf/previewer

lf -remote exits 0 either way, so it's silent when dropped. I guess the config races the server/client startup. I saw this is known in some issues, and the tips mention on-init or starting the server beforehand.

If startup is required to be non-blocking, would lf -remote retrying briefly, or the server buffering sends until the client registers, be reasonable approaches? I'm not sure if these are good ideas, or if there's a better way. Or should I just stick with the workarounds?