1
1
mirror of https://github.com/Eugeny/tabby.git synced 2024-11-27 10:42:35 +03:00

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
commit a241f2b36f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -291,7 +291,12 @@ export class Session extends BaseSession {
return cwd return cwd
} }
if (process.platform === 'linux') { 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 (process.platform === 'win32') {
if (!this.guessedCWD) { if (!this.guessedCWD) {