mirror of
https://github.com/Eugeny/tabby.git
synced 2024-11-24 14:14:24 +03:00
don't crash if no cwd
This commit is contained in:
parent
8cfaf9082b
commit
ab6d5e851b
@ -233,7 +233,12 @@ export class Session extends BaseSession {
|
||||
return null
|
||||
}
|
||||
if (process.platform === 'darwin') {
|
||||
let lines = (await exec(`lsof -p ${this.truePID} -Fn`))[0].toString().split('\n')
|
||||
let lines: string[]
|
||||
try {
|
||||
lines = (await exec(`lsof -p ${this.truePID} -Fn`))[0].toString().split('\n')
|
||||
} catch (e) {
|
||||
return null
|
||||
}
|
||||
if (lines[1] === 'fcwd') {
|
||||
return lines[2].substring(1)
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user