Skip to content

Commit 00fabee

Browse files
CopilotTyriar
andcommitted
Remove redundant writeDataToTerminal command
Co-authored-by: Tyriar <[email protected]>
1 parent 340c1bb commit 00fabee

File tree

2 files changed

+0
-36
lines changed

2 files changed

+0
-36
lines changed

src/vs/workbench/contrib/terminalContrib/developer/browser/terminal.developer.contribution.ts

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -61,41 +61,6 @@ registerTerminalAction({
6161
}
6262
});
6363

64-
registerTerminalAction({
65-
id: TerminalDeveloperCommandId.WriteDataToTerminal,
66-
title: localize2('workbench.action.terminal.writeDataToTerminal', 'Write Data to Terminal'),
67-
category: Categories.Developer,
68-
run: async (c, accessor) => {
69-
const quickInputService = accessor.get(IQuickInputService);
70-
const instance = await c.service.getActiveOrCreateInstance();
71-
await c.service.revealActiveTerminal();
72-
await instance.processReady;
73-
if (!instance.xterm) {
74-
throw new Error('Cannot write data to terminal if xterm isn\'t initialized');
75-
}
76-
const data = await quickInputService.input({
77-
value: '',
78-
placeHolder: 'Enter data, use \\x to escape',
79-
prompt: localize('workbench.action.terminal.writeDataToTerminal.prompt', "Enter data to write directly to the terminal, bypassing the pty"),
80-
});
81-
if (!data) {
82-
return;
83-
}
84-
let escapedData = data
85-
.replace(/\\n/g, '\n')
86-
.replace(/\\r/g, '\r');
87-
while (true) {
88-
const match = escapedData.match(/\\x([0-9a-fA-F]{2})/);
89-
if (match === null || match.index === undefined || match.length < 2) {
90-
break;
91-
}
92-
escapedData = escapedData.slice(0, match.index) + String.fromCharCode(parseInt(match[1], 16)) + escapedData.slice(match.index + 4);
93-
}
94-
const xterm = instance.xterm as any as IInternalXtermTerminal;
95-
xterm._writeText(escapedData);
96-
}
97-
});
98-
9964
registerTerminalAction({
10065
id: TerminalDeveloperCommandId.RecordSession,
10166
title: localize2('workbench.action.terminal.recordSession', 'Record Terminal Session'),

src/vs/workbench/contrib/terminalContrib/developer/common/terminal.developer.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
export const enum TerminalDeveloperCommandId {
7-
WriteDataToTerminal = 'workbench.action.terminal.writeDataToTerminal',
87
RecordSession = 'workbench.action.terminal.recordSession',
98
ShowTextureAtlas = 'workbench.action.terminal.showTextureAtlas',
109
RestartPtyHost = 'workbench.action.terminal.restartPtyHost',

0 commit comments

Comments
 (0)