@@ -1232,7 +1232,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
12321232 // Set the initial name based on the _resolved_ shell launch config, this will also
12331233 // ensure the resolved icon gets shown
12341234 if ( ! this . _labelComputer ) {
1235- this . _labelComputer = this . _register ( new TerminalLabelComputer ( this . _configHelper , this , this . _workspaceContextService ) ) ;
1235+ this . _labelComputer = this . _register ( new TerminalLabelComputer ( this . _configHelper , this , this . _workspaceContextService , this . shellLaunchConfig . splitInheritedCwd ) ) ;
12361236 this . _labelComputer . onDidChangeLabel ( e => {
12371237 this . _title = e . title ;
12381238 this . _description = e . description ;
@@ -2257,7 +2257,8 @@ export class TerminalLabelComputer extends Disposable {
22572257 constructor (
22582258 private readonly _configHelper : TerminalConfigHelper ,
22592259 private readonly _instance : Pick < ITerminalInstance , 'shellLaunchConfig' | 'cwd' | 'fixedCols' | 'fixedRows' | 'initialCwd' | 'processName' | 'sequence' | 'userHome' | 'workspaceFolder' | 'staticTitle' | 'capabilities' | 'title' | 'description' > ,
2260- @IWorkspaceContextService private readonly _workspaceContextService : IWorkspaceContextService
2260+ @IWorkspaceContextService private readonly _workspaceContextService : IWorkspaceContextService ,
2261+ private readonly _splitInheritedCwd ?: boolean
22612262 ) {
22622263 super ( ) ;
22632264 }
@@ -2298,7 +2299,7 @@ export class TerminalLabelComputer extends Disposable {
22982299 const detection = this . _instance . capabilities . has ( TerminalCapability . CwdDetection ) || this . _instance . capabilities . has ( TerminalCapability . NaiveCwdDetection ) ;
22992300 const zeroRootWorkspace = this . _workspaceContextService . getWorkspace ( ) . folders . length === 0 && this . pathsEqual ( templateProperties . cwd , this . _instance . userHome || this . _configHelper . config . cwd ) ;
23002301 const singleRootWorkspace = this . _workspaceContextService . getWorkspace ( ) . folders . length === 1 && this . pathsEqual ( templateProperties . cwd , this . _configHelper . config . cwd || this . _workspaceContextService . getWorkspace ( ) . folders [ 0 ] ?. uri . fsPath ) ;
2301- if ( this . _instance . cwd !== this . _instance . initialCwd ) {
2302+ if ( ( this . _instance . cwd !== this . _instance . initialCwd ) || this . _splitInheritedCwd ) {
23022303 templateProperties . cwdFolder = ( ! templateProperties . cwd || ! detection || zeroRootWorkspace || singleRootWorkspace ) ? '' : path . basename ( templateProperties . cwd ) ;
23032304 }
23042305
0 commit comments