Skip to content

Commit c819318

Browse files
committed
⚗️ Add tests to verify handling sequence OSC 9; 9 ; CWD ST
Signed-off-by: Babak K. Shandiz <[email protected]>
1 parent 515c6c2 commit c819318

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/vs/workbench/contrib/terminal/test/browser/xterm/shellIntegrationAddon.test.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,21 @@ suite('ShellIntegrationAddon', () => {
113113
});
114114
});
115115
});
116+
117+
test('detect `SetWindowsFrindlyCwd` sequence: `OSC 9 ; 9 ; <cwd> ST`', async () => {
118+
type TestCase = [title: string, input: string, expected: string];
119+
const cases: TestCase[] = [
120+
['root', '/', '/'],
121+
['non-root', '/some/path', '/some/path'],
122+
];
123+
for (const x of cases) {
124+
const [title, input, expected] = x;
125+
const mock = shellIntegrationAddon.getCwdDectionMock();
126+
mock.expects('updateCwd').once().withExactArgs(expected).named(title);
127+
await writeP(xterm, `\x1b]9;9;${input}\x07`);
128+
mock.verify();
129+
}
130+
});
116131
});
117132

118133
suite('command tracking', async () => {

0 commit comments

Comments
 (0)