Skip to content

Don't monkey patch vscode ext API #24103

Open

Description

😱

/**
* Monkeypatch the terminal to log commands sent.
*/
function monkeyPatchTerminal(terminal: Terminal) {
if (!(terminal as any).isPatched) {
const oldSendText = terminal.sendText.bind(terminal);
terminal.sendText = (text: string, addNewLine: boolean = true) => {
traceLog(`Send text to terminal: ${text}`);
return oldSendText(text, addNewLine);
};
(terminal as any).isPatched = true;
}
return terminal;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    debtCovers everything internal: CI, testing, refactoring of the codebase, etc.needs PRReady to be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions