From 09c20d3da5cb0e36b612e4f3ddc764376ae24178 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Fri, 4 Sep 2026 14:01:28 +0200 Subject: modules/lf/wrappers/ll: Rework the way the syscmds get propagated Proxying all stdout breaks launching nvim from lf and also in general a lot of shell applications. --- modules/by-name/lf/lf/commands/default.nix | 2 +- modules/by-name/lf/lf/wrappers/ll.fish | 25 ++++++++++++++++--------- 2 files changed, 17 insertions(+), 10 deletions(-) (limited to 'modules') diff --git a/modules/by-name/lf/lf/commands/default.nix b/modules/by-name/lf/lf/commands/default.nix index 0c0acecf..a6c4a3f9 100644 --- a/modules/by-name/lf/lf/commands/default.nix +++ b/modules/by-name/lf/lf/commands/default.nix @@ -30,7 +30,7 @@ syscmd = command: '' ''${{ - printf "%s\n" "SYSCMD::${command}" + printf "%s\n" "SYSCMD::${command}" >>"$LL_SYSCMD_SOCKET" }} ''; diff --git a/modules/by-name/lf/lf/wrappers/ll.fish b/modules/by-name/lf/lf/wrappers/ll.fish index 6478d6f1..2600f14b 100644 --- a/modules/by-name/lf/lf/wrappers/ll.fish +++ b/modules/by-name/lf/lf/wrappers/ll.fish @@ -14,17 +14,24 @@ begin test -d "$XDG_RUNTIME_DIR/ll"; or mkdir "$XDG_RUNTIME_DIR/ll" set last_directory "$XDG_RUNTIME_DIR/ll/last_directory" - command lf -last-dir-path="$last_directory" "$argv" 2>&1 | while read -l cmd - switch "$cmd" - case "SYSCMD::DIRENV::SANDBOX::ENABLE" - set --global SHOULD_SANDBOX_DIRENV - case "SYSCMD::DIRENV::SANDBOX::DISABLE" - set --erase SHOULD_SANDBOX_DIRENV - case '*' - # Just pass things along, that we don't know about - printf "%s\n\r" "$cmd" >&2 + set --export LL_SYSCMD_SOCKET "$(mktemp -t fish_ll_syscmd_socket)" + begin + command lf -last-dir-path="$last_directory" "$argv" + + cat "$LL_SYSCMD_SOCKET" | while read -l cmd + switch "$cmd" + case "SYSCMD::DIRENV::SANDBOX::ENABLE" + set --global SHOULD_SANDBOX_DIRENV + case "SYSCMD::DIRENV::SANDBOX::DISABLE" + set --erase SHOULD_SANDBOX_DIRENV + case '*' + # Just pass things along, that we don't know about + printf "%s\n\r" "$cmd" >&2 + end end end + rm "$LL_SYSCMD_SOCKET" + set --erase --export LL_SYSCMD_SOCKET set dir "$(cat "$last_directory")" -- cgit v1.3.1