Catch errors when trying to derive CWD in Linux (#1798)

Catch errors when trying to derive CWD in Linux
This commit is contained in:
Eugene
2019-11-25 11:31:07 +01:00
committed by GitHub

View File

@@ -291,7 +291,12 @@ export class Session extends BaseSession {
return cwd
}
if (process.platform === 'linux') {
return fs.readlink(`/proc/${this.truePID}/cwd`)
try {
return await fs.readlink(`/proc/${this.truePID}/cwd`)
} catch (exc) {
console.error(exc)
return null
}
}
if (process.platform === 'win32') {
if (!this.guessedCWD) {