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; }