1
1
mirror of https://github.com/Eugeny/tabby.git synced 2024-11-27 18:55:58 +03:00

fixed cwd detection on el capitan (fixes #63)

This commit is contained in:
Eugene Pankov 2017-07-06 10:37:52 +02:00
parent 8ee93297be
commit 50968508df

View File

@ -118,7 +118,11 @@ export class Session {
async getWorkingDirectory (): Promise<string> {
if (process.platform === 'darwin') {
let lines = (await exec(`lsof -p ${this.truePID} -Fn`))[0].toString().split('\n')
return lines[2].substring(1)
if (lines[1] === 'fcwd') {
return lines[2].substring(1)
} else {
return lines[1].substring(1)
}
}
if (process.platform === 'linux') {
return await fs.readlink(`/proc/${this.truePID}/cwd`)