aboutsummaryrefslogtreecommitdiffstats
path: root/modules/by-name/lf
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-11-25 16:21:21 +0100
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-11-25 16:21:21 +0100
commitdf5ee622ce16070f59dd9195f89479bf0cfd92e0 (patch)
tree78734a7e7fdc4a1eb081d82bbf726faf9d44630a /modules/by-name/lf
parentfix(modules/lf/ctpv/): Support color output, by simulating a interactive shell (diff)
downloadnixos-config-df5ee622ce16070f59dd9195f89479bf0cfd92e0.zip
fix(modules/lf): Ensure, that the remote mapping source command works
Diffstat (limited to 'modules/by-name/lf')
-rw-r--r--modules/by-name/lf/lf/module.nix9
1 files changed, 6 insertions, 3 deletions
diff --git a/modules/by-name/lf/lf/module.nix b/modules/by-name/lf/lf/module.nix
index 7c31b711..44b7af0e 100644
--- a/modules/by-name/lf/lf/module.nix
+++ b/modules/by-name/lf/lf/module.nix
@@ -46,8 +46,8 @@ in {
source = lib.getExe' pkgs.ctpv "ctpv";
};
settings = {
- # close the server, after the last client exits
- autoquit = true;
+ # Always keep the server running
+ autoquit = false;
# disable the cusor in the preview pane
cursorpreviewfmt = "";
@@ -76,10 +76,13 @@ in {
set cleaner ${pkgs.ctpv}/bin/ctpvclear
# Dynamically generate the cd mappings.
+ # This code dependends on the fact, that the lf server was started previously
+ # and keep running through `autoquit = false`.
+ # (Otherwise, the remote command is silently dropped: https://github.com/gokcehan/lf/issues/495)
&{{
tmp="$(mktemp)"
${lib.getExe pkgs.lf-make-map} --depth 4 generate ~/media ~/repos ~/school >"$tmp"
- lf -remote "send source $tmp"
+ lf -remote "send $id source $tmp"
rm "$tmp"
}}
'';