TerminalView

Lookup
Section titled “Lookup”import { BottomBarPanel, TerminalView } from 'vscode-extension-tester';...const terminalView = await new BottomBarPanel().openTerminalView();Terminal Selection
Section titled “Terminal Selection”// get names of all available terminalsconst names = await terminalView.getChannelNames();// select a terminal from the drop box by nameawait terminalView.selectChannel("Git");Execute Commands
Section titled “Execute Commands”await terminalView.executeCommand("git status");Get Text
Section titled “Get Text”Select all text and copy it to a variable. No formatting provided.
- This relies on
terminal.integrated.copyOnSelection: true, which ExTester applies automatically as part of its default settings on every platform. It is only a concern if you override the framework defaults with your own settings file.
const text = await terminalView.getText();Manage Terminals
Section titled “Manage Terminals”Create a new terminal or kill the active one.
// create a new terminal instanceawait terminalView.newTerminal();// kill the active terminal instanceawait terminalView.killTerminal();