-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Labels
apibugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable buginsiders-releasedPatch has been released in VS Code InsidersPatch has been released in VS Code InsidersterminalGeneral terminal issues that don't fall under another labelGeneral terminal issues that don't fall under another labelverifiedVerification succeededVerification succeeded
Milestone
Description
Here is my code snippet
const ptyWriteEmitter = new vscode.EventEmitter<string>();
const pty = {
onDidWrite: this.ptyWriteEmitter.event,
open: () => {
this.ptyWriteEmitter.fire(`\x1b[31m${name}\x1b[0m\r\n\r\n`);
},
close: () => {
},
handleInput: (data: string) => {
// Echo the data
if (data === '\r') {
data = '\n';
}
if (data.charCodeAt(0) === 127) {
// Delete last character
this.ptyWriteEmitter.fire('\x1b[D\x1b[P');
this.inputBuffer.splice(this.inputBuffer.length - 1, 1);
} else {
this.ptyWriteEmitter.fire(data === '\n' ? '\r\n' : data);
this.inputBuffer.push(data);
}
if (data === '\n' && this.lineAvailable !== undefined) {
this.lineAvailable();
}
}
};
const terminal = window.createTerminal({ name: 'Python Terminal', pty: pty });
terminal.show();Trying to run this creates:
ERR A container element needs to be set with `attachToElement` and be part of the DOM before calling `_open`: Error: A container element needs to be set with `attachToElement` and be part of the DOM before calling `_open`
at Ui._open (https://main.vscode-cdn.net/insider/b3546b4bb5aff5254ef857cfd68a3da8534c068f/out/vs/workbench/workbench.web.main.js:3097:46503)
at Ui.setVisible (https://main.vscode-cdn.net/insider/b3546b4bb5aff5254ef857cfd68a3da8534c068f/out/vs/workbench/workbench.web.main.js:3099:2561)
at h.showPanel (https://main.vscode-cdn.net/insider/b3546b4bb5aff5254ef857cfd68a3da8534c068f/out/vs/workbench/workbench.web.main.js:3097:22123)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
apibugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable buginsiders-releasedPatch has been released in VS Code InsidersPatch has been released in VS Code InsidersterminalGeneral terminal issues that don't fall under another labelGeneral terminal issues that don't fall under another labelverifiedVerification succeededVerification succeeded