Skip to content

Commit 5475dfe

Browse files
authored
create cwd detection and update it when command detection is deserialized (microsoft#239238)
1 parent 66772c0 commit 5475dfe

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/vs/platform/terminal/common/xterm/shellIntegrationAddon.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,12 @@ export class ShellIntegrationAddon extends Disposable implements IShellIntegrati
659659
if (!this._terminal) {
660660
throw new Error('Cannot restore commands before addon is activated');
661661
}
662-
this._createOrGetCommandDetection(this._terminal).deserialize(serialized);
662+
const commandDetection = this._createOrGetCommandDetection(this._terminal);
663+
commandDetection.deserialize(serialized);
664+
if (commandDetection.cwd) {
665+
// Cwd gets set when the command is deserialized, so we need to update it here
666+
this._updateCwd(commandDetection.cwd);
667+
}
663668
}
664669

665670
protected _createOrGetCwdDetection(): ICwdDetectionCapability {

0 commit comments

Comments
 (0)