mirror of
https://github.com/Eugeny/tabby.git
synced 2025-09-24 09:06:03 +00:00
strip data-volume prefix from CWD on Catalina
This commit is contained in:
@@ -28,6 +28,7 @@ export interface ChildProcess {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const windowsDirectoryRegex = /([a-zA-Z]:[^\:\[\]\?\"\<\>\|]+)/mi
|
const windowsDirectoryRegex = /([a-zA-Z]:[^\:\[\]\?\"\<\>\|]+)/mi
|
||||||
|
const catalinaDataVolumePrefix = '/System/Volumes/Data'
|
||||||
const OSC1337Prefix = '\x1b]1337;'
|
const OSC1337Prefix = '\x1b]1337;'
|
||||||
const OSC1337Suffix = '\x07'
|
const OSC1337Suffix = '\x07'
|
||||||
|
|
||||||
@@ -282,11 +283,11 @@ export class Session extends BaseSession {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
if (lines[1] === 'fcwd') {
|
let cwd = lines[(lines[1] === 'fcwd') ? 2 : 1].substring(1)
|
||||||
return lines[2].substring(1)
|
if (cwd.startsWith(catalinaDataVolumePrefix)) {
|
||||||
} else {
|
cwd = cwd.substring(catalinaDataVolumePrefix.length)
|
||||||
return lines[1].substring(1)
|
|
||||||
}
|
}
|
||||||
|
return cwd
|
||||||
}
|
}
|
||||||
if (process.platform === 'linux') {
|
if (process.platform === 'linux') {
|
||||||
return fs.readlink(`/proc/${this.truePID}/cwd`)
|
return fs.readlink(`/proc/${this.truePID}/cwd`)
|
||||||
|
Reference in New Issue
Block a user