Skip to content

Commit

Permalink
fixed cwd detection on el capitan (fixes #63)
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugeny committed Jul 6, 2017
1 parent 8ee9329 commit 5096850
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion terminus-terminal/src/services/sessions.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`)
Expand Down

0 comments on commit 5096850

Please sign in to comment.