@@ -1232,7 +1232,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
1232
1232
// Set the initial name based on the _resolved_ shell launch config, this will also
1233
1233
// ensure the resolved icon gets shown
1234
1234
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 ) ) ;
1236
1236
this . _labelComputer . onDidChangeLabel ( e => {
1237
1237
this . _title = e . title ;
1238
1238
this . _description = e . description ;
@@ -2257,7 +2257,8 @@ export class TerminalLabelComputer extends Disposable {
2257
2257
constructor (
2258
2258
private readonly _configHelper : TerminalConfigHelper ,
2259
2259
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
2261
2262
) {
2262
2263
super ( ) ;
2263
2264
}
@@ -2298,7 +2299,7 @@ export class TerminalLabelComputer extends Disposable {
2298
2299
const detection = this . _instance . capabilities . has ( TerminalCapability . CwdDetection ) || this . _instance . capabilities . has ( TerminalCapability . NaiveCwdDetection ) ;
2299
2300
const zeroRootWorkspace = this . _workspaceContextService . getWorkspace ( ) . folders . length === 0 && this . pathsEqual ( templateProperties . cwd , this . _instance . userHome || this . _configHelper . config . cwd ) ;
2300
2301
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 ) {
2302
2303
templateProperties . cwdFolder = ( ! templateProperties . cwd || ! detection || zeroRootWorkspace || singleRootWorkspace ) ? '' : path . basename ( templateProperties . cwd ) ;
2303
2304
}
2304
2305
0 commit comments