From 50968508df56629108287a1308341c3435e0f070 Mon Sep 17 00:00:00 2001 From: Eugene Pankov Date: Thu, 6 Jul 2017 10:37:52 +0200 Subject: [PATCH] fixed cwd detection on el capitan (fixes #63) --- terminus-terminal/src/services/sessions.service.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/terminus-terminal/src/services/sessions.service.ts b/terminus-terminal/src/services/sessions.service.ts index 4a3c4ecb..740061d8 100644 --- a/terminus-terminal/src/services/sessions.service.ts +++ b/terminus-terminal/src/services/sessions.service.ts @@ -118,7 +118,11 @@ export class Session { async getWorkingDirectory (): Promise { 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`)