diff --git a/lua/CopilotChat/config/mappings.lua b/lua/CopilotChat/config/mappings.lua index 73cb25a0..3bd339cc 100644 --- a/lua/CopilotChat/config/mappings.lua +++ b/lua/CopilotChat/config/mappings.lua @@ -450,7 +450,6 @@ return { utils.schedule_main() table.insert(lines, '**Logs**: `' .. copilot.config.log_path .. '`') table.insert(lines, '**History**: `' .. copilot.config.history_path .. '`') - table.insert(lines, '**Temp Files**: `' .. vim.fn.fnamemodify(os.tmpname(), ':h') .. '`') table.insert(lines, '') for provider, infolines in pairs(infos) do diff --git a/lua/CopilotChat/health.lua b/lua/CopilotChat/health.lua index a75416ee..acfc5bd2 100644 --- a/lua/CopilotChat/health.lua +++ b/lua/CopilotChat/health.lua @@ -55,6 +55,25 @@ function M.check() error('setup: not called, required for plugin to work. See `:h CopilotChat-installation`.') end + start('CopilotChat.nvim [filesystem]') + + local testfile = os.tmpname() + local f = io.open(testfile, 'w') + local writable = false + if f then + f:write('test') + f:close() + writable = true + end + if writable then + ok('temp dir: writable (' .. testfile .. ')') + os.remove(testfile) + else + local stat = vim.loop.fs_stat(vim.fn.fnamemodify(testfile, ':h')) + local perms = stat and string.format('%o', stat.mode % 512) or 'unknown' + error('temp dir: not writable. Permissions: ' .. perms .. ' (dir: ' .. vim.fn.fnamemodify(testfile, ':h') .. ')') + end + start('CopilotChat.nvim [commands]') local curl_version = run_command('curl', '--version')