File tree Expand file tree Collapse file tree 1 file changed +23
-2
lines changed
src/vs/platform/terminal/common/xterm Expand file tree Collapse file tree 1 file changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -158,7 +158,12 @@ const enum ITermOscPt {
158
158
/**
159
159
* Sets a mark/point-of-interest in the buffer. `OSC 1337 ; SetMark`
160
160
*/
161
- SetMark = 'SetMark'
161
+ SetMark = 'SetMark' ,
162
+
163
+ /**
164
+ * Reports current working directory (CWD). `OSC 1337 ; CurrentDir=<Cwd> ST`
165
+ */
166
+ CurrentDir = 'CurrentDir'
162
167
}
163
168
164
169
/**
@@ -337,7 +342,6 @@ export class ShellIntegrationAddon extends Disposable implements IShellIntegrati
337
342
switch ( key ) {
338
343
case 'Cwd' : {
339
344
// TODO: Ideally we would also support the following to supplement our own:
340
- // - OSC 1337 ; CurrentDir=<Cwd> ST (iTerm)
341
345
// - OSC 7 ; scheme://cwd ST (Unknown origin)
342
346
// - OSC 9 ; 9 ; <cwd> ST (cmder)
343
347
this . _updateCwd ( value ) ;
@@ -374,7 +378,24 @@ export class ShellIntegrationAddon extends Disposable implements IShellIntegrati
374
378
case ITermOscPt . SetMark : {
375
379
this . _createOrGetCommandDetection ( this . _terminal ) . handleGenericCommand ( { genericMarkProperties : { disableCommandStorage : true } } ) ;
376
380
}
381
+ default : {
382
+ // Checking for known `<key>=<value>` pairs.
383
+ const { key, value } = this . _parseKeyValueAssignment ( command ) ;
384
+
385
+ if ( value === undefined ) {
386
+ // No '=' was found, so it's not a property assignment.
387
+ return true ;
388
+ }
389
+
390
+ switch ( key ) {
391
+ case ITermOscPt . CurrentDir :
392
+ // Encountered: `OSC 1337 ; CurrentDir=<Cwd> ST`
393
+ this . _updateCwd ( value ) ;
394
+ return true ;
395
+ }
396
+ }
377
397
}
398
+
378
399
// Unrecognized sequence
379
400
return false ;
380
401
}
You can’t perform that action at this time.
0 commit comments