diff --git a/lua/presence/init.lua b/lua/presence/init.lua index 56e76e9..cd19023 100644 --- a/lua/presence/init.lua +++ b/lua/presence/init.lua @@ -84,7 +84,7 @@ function Presence:setup(options) local os_name = self.get_os_name(uname) self.os = { name = os_name, - is_wsl = uname.release:find("Microsoft") ~= nil, + is_wsl = uname.release:lower():find("microsoft") ~= nil, path_separator = separator, } @@ -365,9 +365,12 @@ function Presence:get_discord_socket_path() elseif self.os.name == "macos" then -- Use $TMPDIR for macOS local path = os.getenv("TMPDIR") - sock_path = path:match("/$") - and path..sock_name - or path.."/"..sock_name + + if path then + sock_path = path:match("/$") + and path..sock_name + or path.."/"..sock_name + end elseif self.os.name == "linux" then -- Check various temp directory environment variables local env_vars = {