@@ -58,15 +58,30 @@ suite('ShellIntegrationAddon', () => {
58
58
await writeP ( xterm , '\x1b]633;P;Cwd=/foo\x07' ) ;
59
59
strictEqual ( capabilities . has ( TerminalCapability . CwdDetection ) , true ) ;
60
60
} ) ;
61
+
61
62
test ( 'should pass cwd sequence to the capability' , async ( ) => {
62
63
const mock = shellIntegrationAddon . getCwdDectionMock ( ) ;
63
64
mock . expects ( 'updateCwd' ) . once ( ) . withExactArgs ( '/foo' ) ;
64
65
await writeP ( xterm , '\x1b]633;P;Cwd=/foo\x07' ) ;
65
66
mock . verify ( ) ;
66
67
} ) ;
67
68
68
- suite ( 'detect `SetCwd` sequence: `OSC 7; scheme://cwd ST`' , async ( ) => {
69
+ test ( 'detect ITerm sequence: `OSC 1337 ; CurrentDir=<Cwd> ST`' , async ( ) => {
70
+ type TestCase = [ title : string , input : string , expected : string ] ;
71
+ const cases : TestCase [ ] = [
72
+ [ 'root' , '/' , '/' ] ,
73
+ [ 'non-root' , '/some/path' , '/some/path' ] ,
74
+ ] ;
75
+ for ( const x of cases ) {
76
+ const [ title , input , expected ] = x ;
77
+ const mock = shellIntegrationAddon . getCwdDectionMock ( ) ;
78
+ mock . expects ( 'updateCwd' ) . once ( ) . withExactArgs ( expected ) . named ( title ) ;
79
+ await writeP ( xterm , `\x1b]1337;CurrentDir=${ input } \x07` ) ;
80
+ mock . verify ( ) ;
81
+ }
82
+ } ) ;
69
83
84
+ suite ( 'detect `SetCwd` sequence: `OSC 7; scheme://cwd ST`' , async ( ) => {
70
85
test ( 'should accept well-formatted URLs' , async ( ) => {
71
86
type TestCase = [ title : string , input : string , expected : string ] ;
72
87
const cases : TestCase [ ] = [
0 commit comments