From 47366e7e1ff969ab1dae0bd34d55f9018dac9ef4 Mon Sep 17 00:00:00 2001 From: "blink-so[bot]" <211532188+blink-so[bot]@users.noreply.github.com> Date: Wed, 16 Jul 2025 10:41:56 +0000 Subject: [PATCH] fix: construct full path for workspaceLogPath instead of just filename The workspaceLogPath was being set to just the log filename instead of the full path, causing VS Code to fail when trying to open the log file with 'Unable to resolve nonexistent file' errors. This fix ensures that path.join(logDir, logFileName) is used to construct the complete file path, allowing the 'View Logs' command to work properly when coder.proxyLogDirectory is configured. Fixes the issue where log files like 'coder-ssh-20250716-123428-qvict-90716.log' could not be opened because they were referenced by filename only. Co-authored-by: ibetitsmike <203725896+ibetitsmike@users.noreply.github.com> --- src/remote.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/remote.ts b/src/remote.ts index 4a13ae56..6397ba08 100644 --- a/src/remote.ts +++ b/src/remote.ts @@ -609,11 +609,14 @@ export class Remote { disposables.push(this.showNetworkUpdates(pid)); if (logDir) { const logFiles = await fs.readdir(logDir); - this.commands.workspaceLogPath = logFiles + const logFileName = logFiles .reverse() .find( (file) => file === `${pid}.log` || file.endsWith(`-${pid}.log`), ); + this.commands.workspaceLogPath = logFileName + ? path.join(logDir, logFileName) + : undefined; } else { this.commands.workspaceLogPath = undefined; }