Skip to content

Commit 670d678

Browse files
CopilotTyriar
andcommitted
Update test files to use SendSequence instead of WriteDataToTerminal
Co-authored-by: Tyriar <[email protected]>
1 parent 00fabee commit 670d678

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

src/vs/workbench/contrib/terminal/browser/terminalActions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ export const terminalSendSequenceCommand = async (accessor: ServicesAccessor, ar
142142
}
143143
}
144144

145-
// Process escape sequences similar to WriteDataToTerminal
145+
// Process escape sequences
146146
let processedText = text
147147
.replace(/\\n/g, '\n')
148148
.replace(/\\r/g, '\r');

test/automation/src/terminal.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export enum TerminalCommandIdWithValue {
4040
NewWithProfile = 'workbench.action.terminal.newWithProfile',
4141
SelectDefaultProfile = 'workbench.action.terminal.selectDefaultShell',
4242
AttachToSession = 'workbench.action.terminal.attachToSession',
43-
WriteDataToTerminal = 'workbench.action.terminal.writeDataToTerminal'
43+
SendSequence = 'workbench.action.terminal.sendSequence'
4444
}
4545

4646
/**
@@ -155,7 +155,7 @@ export class Terminal {
155155
/**
156156
* Creates an empty terminal by opening a regular terminal and resetting its state such that it
157157
* essentially acts like an Pseudoterminal extension API-based terminal. This can then be paired
158-
* with `TerminalCommandIdWithValue.WriteDataToTerminal` to make more reliable tests.
158+
* with `TerminalCommandIdWithValue.SendSequence` to make more reliable tests.
159159
*/
160160
async createEmptyTerminal(expectedLocation?: 'editor' | 'panel'): Promise<void> {
161161
await this.createTerminal(expectedLocation);
@@ -166,11 +166,11 @@ export class Terminal {
166166
await this.waitForTerminalText(buffer => buffer.some(line => line.startsWith('initialized')));
167167

168168
// Erase all content and reset cursor to top
169-
await this.runCommandWithValue(TerminalCommandIdWithValue.WriteDataToTerminal, `${csi('2J')}${csi('H')}`);
169+
await this.runCommandWithValue(TerminalCommandIdWithValue.SendSequence, `${csi('2J')}${csi('H')}`);
170170

171171
// Force windows pty mode off; assume all sequences are rendered in correct position
172172
if (process.platform === 'win32') {
173-
await this.runCommandWithValue(TerminalCommandIdWithValue.WriteDataToTerminal, `${vsc('P;IsWindows=False')}`);
173+
await this.runCommandWithValue(TerminalCommandIdWithValue.SendSequence, `${vsc('P;IsWindows=False')}`);
174174
}
175175
}
176176

test/smoke/src/areas/terminal/terminal-shellIntegration.test.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -98,33 +98,33 @@ export function setup(options?: { skipSuite: boolean }) {
9898
// Use the simplest profile to get as little process interaction as possible
9999
await terminal.createEmptyTerminal();
100100
// Erase all content and reset cursor to top
101-
await terminal.runCommandWithValue(TerminalCommandIdWithValue.WriteDataToTerminal, `${csi('2J')}${csi('H')}`);
101+
await terminal.runCommandWithValue(TerminalCommandIdWithValue.SendSequence, `${csi('2J')}${csi('H')}`);
102102
});
103103
describe('VS Code sequences', () => {
104104
it('should handle the simple case', async () => {
105-
await terminal.runCommandWithValue(TerminalCommandIdWithValue.WriteDataToTerminal, `${vsc('A')}Prompt> ${vsc('B')}exitcode 0`);
105+
await terminal.runCommandWithValue(TerminalCommandIdWithValue.SendSequence, `${vsc('A')}Prompt> ${vsc('B')}exitcode 0`);
106106
await terminal.assertCommandDecorations({ placeholder: 1, success: 0, error: 0 });
107-
await terminal.runCommandWithValue(TerminalCommandIdWithValue.WriteDataToTerminal, `\\r\\n${vsc('C')}Success\\r\\n${vsc('D;0')}`);
107+
await terminal.runCommandWithValue(TerminalCommandIdWithValue.SendSequence, `\\r\\n${vsc('C')}Success\\r\\n${vsc('D;0')}`);
108108
await terminal.assertCommandDecorations({ placeholder: 0, success: 1, error: 0 });
109-
await terminal.runCommandWithValue(TerminalCommandIdWithValue.WriteDataToTerminal, `${vsc('A')}Prompt> ${vsc('B')}exitcode 1`);
109+
await terminal.runCommandWithValue(TerminalCommandIdWithValue.SendSequence, `${vsc('A')}Prompt> ${vsc('B')}exitcode 1`);
110110
await terminal.assertCommandDecorations({ placeholder: 1, success: 1, error: 0 });
111-
await terminal.runCommandWithValue(TerminalCommandIdWithValue.WriteDataToTerminal, `\\r\\n${vsc('C')}Failure\\r\\n${vsc('D;1')}`);
111+
await terminal.runCommandWithValue(TerminalCommandIdWithValue.SendSequence, `\\r\\n${vsc('C')}Failure\\r\\n${vsc('D;1')}`);
112112
await terminal.assertCommandDecorations({ placeholder: 0, success: 1, error: 1 });
113-
await terminal.runCommandWithValue(TerminalCommandIdWithValue.WriteDataToTerminal, `${vsc('A')}Prompt> ${vsc('B')}`);
113+
await terminal.runCommandWithValue(TerminalCommandIdWithValue.SendSequence, `${vsc('A')}Prompt> ${vsc('B')}`);
114114
await terminal.assertCommandDecorations({ placeholder: 1, success: 1, error: 1 });
115115
});
116116
});
117117
describe('Final Term sequences', () => {
118118
it('should handle the simple case', async () => {
119-
await terminal.runCommandWithValue(TerminalCommandIdWithValue.WriteDataToTerminal, `${ft('A')}Prompt> ${ft('B')}exitcode 0`);
119+
await terminal.runCommandWithValue(TerminalCommandIdWithValue.SendSequence, `${ft('A')}Prompt> ${ft('B')}exitcode 0`);
120120
await terminal.assertCommandDecorations({ placeholder: 1, success: 0, error: 0 });
121-
await terminal.runCommandWithValue(TerminalCommandIdWithValue.WriteDataToTerminal, `\\r\\n${ft('C')}Success\\r\\n${ft('D;0')}`);
121+
await terminal.runCommandWithValue(TerminalCommandIdWithValue.SendSequence, `\\r\\n${ft('C')}Success\\r\\n${ft('D;0')}`);
122122
await terminal.assertCommandDecorations({ placeholder: 0, success: 1, error: 0 });
123-
await terminal.runCommandWithValue(TerminalCommandIdWithValue.WriteDataToTerminal, `${ft('A')}Prompt> ${ft('B')}exitcode 1`);
123+
await terminal.runCommandWithValue(TerminalCommandIdWithValue.SendSequence, `${ft('A')}Prompt> ${ft('B')}exitcode 1`);
124124
await terminal.assertCommandDecorations({ placeholder: 1, success: 1, error: 0 });
125-
await terminal.runCommandWithValue(TerminalCommandIdWithValue.WriteDataToTerminal, `\\r\\n${ft('C')}Failure\\r\\n${ft('D;1')}`);
125+
await terminal.runCommandWithValue(TerminalCommandIdWithValue.SendSequence, `\\r\\n${ft('C')}Failure\\r\\n${ft('D;1')}`);
126126
await terminal.assertCommandDecorations({ placeholder: 0, success: 1, error: 1 });
127-
await terminal.runCommandWithValue(TerminalCommandIdWithValue.WriteDataToTerminal, `${ft('A')}Prompt> ${ft('B')}exitcode 1`);
127+
await terminal.runCommandWithValue(TerminalCommandIdWithValue.SendSequence, `${ft('A')}Prompt> ${ft('B')}exitcode 1`);
128128
await terminal.assertCommandDecorations({ placeholder: 1, success: 1, error: 1 });
129129
});
130130
});

test/smoke/src/areas/terminal/terminal-stickyScroll.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export function setup(options?: { skipSuite: boolean }) {
3535
expectedLineCount: number = 1
3636
): Promise<void> {
3737
const data = generateCommandAndOutput(prompt, command, exitCode);
38-
await terminal.runCommandWithValue(TerminalCommandIdWithValue.WriteDataToTerminal, data);
38+
await terminal.runCommandWithValue(TerminalCommandIdWithValue.SendSequence, data);
3939
// Verify line count
4040
await app.code.waitForElements('.terminal-sticky-scroll .xterm-rows > *', true, e => e.length === expectedLineCount);
4141
// Verify content

0 commit comments

Comments
 (0)