Reputation: 777
I am creating a VSCode extension. I don't see any API to clear the terminal. Am I missing something or does it need to be implemented?
I tried looking through the VSCode reference docs, but was not able to find anything helpful.
Upvotes: 0
Views: 515
Reputation: 65623
Philipp Kief is correct that there is no official API. As noted, https://github.com/Microsoft/vscode/issues/17895 tracks adding this
If you absolutely need this functionality, try using the workbench.action.terminal.clear
command to clear the active terminal:
import { commands } from 'vscode';
commands.executeCommand('workbench.action.terminal.clear');
Upvotes: 2