mirror of
https://github.com/Eugeny/tabby.git
synced 2025-07-06 19:39:53 +00:00
fixed cwd detection on el capitan (fixes #63)
This commit is contained in:
parent
8ee93297be
commit
50968508df
@ -118,7 +118,11 @@ export class Session {
|
|||||||
async getWorkingDirectory (): Promise<string> {
|
async getWorkingDirectory (): Promise<string> {
|
||||||
if (process.platform === 'darwin') {
|
if (process.platform === 'darwin') {
|
||||||
let lines = (await exec(`lsof -p ${this.truePID} -Fn`))[0].toString().split('\n')
|
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') {
|
if (process.platform === 'linux') {
|
||||||
return await fs.readlink(`/proc/${this.truePID}/cwd`)
|
return await fs.readlink(`/proc/${this.truePID}/cwd`)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user