From 52685ad6eec6cdc7cc763a785166929719d6a014 Mon Sep 17 00:00:00 2001 From: TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> Date: Mon, 3 Nov 2025 04:46:27 +0900 Subject: modified plugins/ssh.lua --- mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/ssh.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/ssh.lua b/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/ssh.lua index e9788e0..748191f 100644 --- a/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/ssh.lua +++ b/mac/.config/TheSiahxyz/lua/TheSiahxyz/plugins/ssh.lua @@ -173,7 +173,14 @@ return { }) local api = require("remote-sshfs.api") vim.keymap.set("n", "rc", api.connect, { desc = "Connect SSH" }) - vim.keymap.set("n", "rd", api.disconnect, { desc = "Disconnect SSH" }) + vim.keymap.set("n", "rd", function() + local mountpoint = vim.fn.getcwd() + local ok = vim.system({ "diskutil", "unmount", "force", mountpoint }):wait().code == 0 + if not ok then + ok = vim.system({ "umount", "-f", mountpoint }):wait().code == 0 + end + print(ok and ("✅ Unmounted: " .. mountpoint) or ("⚠️ Failed to unmount: " .. mountpoint)) + end, { desc = "Force unmount macFUSE mount (quiet)" }) vim.keymap.set("n", "re", api.edit, { desc = "Edit SSH" }) -- (optional) Override telescope find_files and live_grep to make dynamic based on if connected to host -- cgit v1.2.3