From 48ca6b18615467c3f669ec79ee521efe29e09acb Mon Sep 17 00:00:00 2001 From: Yan Lin Date: Fri, 24 Oct 2025 14:46:28 +0200 Subject: [PATCH] fix nvim open in file browser --- modules/nvim.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/nvim.nix b/modules/nvim.nix index 93dac13..099436a 100644 --- a/modules/nvim.nix +++ b/modules/nvim.nix @@ -375,12 +375,12 @@ in end end - -- Unicode-safe file operations + -- Unicode-safe file operations (async to prevent blocking) function open_file_with_system_app() local filepath = vim.fn.expand('%:p') if filepath ~= "" then - local escaped_path = vim.fn.shellescape(filepath) - vim.fn.system('xdg-open ' .. escaped_path) + -- Use jobstart for async execution (detach = true prevents blocking) + vim.fn.jobstart({'xdg-open', filepath}, {detach = true}) else print("No file to open") end @@ -389,8 +389,8 @@ in function show_file_in_file_manager() local filepath = vim.fn.expand('%:p') if filepath ~= "" then - local escaped_path = vim.fn.shellescape(filepath) - vim.fn.system('nautilus --select ' .. escaped_path) + -- Use jobstart for async execution (detach = true prevents blocking) + vim.fn.jobstart({'nautilus', '--select', filepath}, {detach = true}) else print("No file to show") end