Skip to content

Commit f86e19e

Browse files
committed
🔨 Extract _updateCwd method for further usage
Signed-off-by: Babak K. Shandiz <[email protected]>
1 parent f73201a commit f86e19e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,9 +342,7 @@ export class ShellIntegrationAddon extends Disposable implements IShellIntegrati
342342
// - OSC 1337 ; CurrentDir=<Cwd> ST (iTerm)
343343
// - OSC 7 ; scheme://cwd ST (Unknown origin)
344344
// - OSC 9 ; 9 ; <cwd> ST (cmder)
345-
this._createOrGetCwdDetection().updateCwd(value);
346-
const commandDetection = this.capabilities.get(TerminalCapability.CommandDetection);
347-
commandDetection?.setCwd(value);
345+
this._updateCwd(value);
348346
return true;
349347
}
350348
case 'IsWindows': {
@@ -362,6 +360,12 @@ export class ShellIntegrationAddon extends Disposable implements IShellIntegrati
362360
return false;
363361
}
364362

363+
private _updateCwd(value: string) {
364+
this._createOrGetCwdDetection().updateCwd(value);
365+
const commandDetection = this.capabilities.get(TerminalCapability.CommandDetection);
366+
commandDetection?.setCwd(value);
367+
}
368+
365369
private _doHandleITermSequence(data: string): boolean {
366370
if (!this._terminal) {
367371
return false;

0 commit comments

Comments
 (0)