Skip to content

Commit 47366e7

Browse files
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 <[email protected]>
1 parent e0adfb8 commit 47366e7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/remote.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,11 +609,14 @@ export class Remote {
609609
disposables.push(this.showNetworkUpdates(pid));
610610
if (logDir) {
611611
const logFiles = await fs.readdir(logDir);
612-
this.commands.workspaceLogPath = logFiles
612+
const logFileName = logFiles
613613
.reverse()
614614
.find(
615615
(file) => file === `${pid}.log` || file.endsWith(`-${pid}.log`),
616616
);
617+
this.commands.workspaceLogPath = logFileName
618+
? path.join(logDir, logFileName)
619+
: undefined;
617620
} else {
618621
this.commands.workspaceLogPath = undefined;
619622
}

0 commit comments

Comments
 (0)