Serial Xterm is a Visual Studio Code extension designed to facilitate communication with serial devices directly from your editor.
Basic serial terminal functionality
AI/Language Model Integration support
Usage
Opening and Closing Serial Port
To open a serial port, click the Connect icon.
To close the serial port, click the Disconnect icon.
Sending Data
You can send data to the connected serial device by typing directly in the terminal.
Other extensions can send data using the serial-xterm.send command.
(Example: vscode.commands.executeCommand('serial-xterm.send', {value: 'your text'});)
Receiving Data and Registering Data Handler
Incoming data from the connected serial device is displayed in the terminal in real-time.
You can register a data handler to redirect received data to your extension.
(Example: vscode.commands.executeCommand('serial-xterm.dataHandler', {dataHandler: 'myExtension.serial-xterm.onData'});)
When data is received, Serial Xterm will call myExtension.serial-xterm.onData with the received data string as an argument.
Clearing Terminal
To clear the terminal output, click the Clear icon.
Dumping All Terminal Contents
To save the current terminal session's output to a new editor tab for analysis or logging, click the Dump icon.
Copy and Paste with Right Click
Right-click to copy selected text from the terminal.
Right-click to paste text from clipboard to the terminal.
AI/Language Model Integration
Serial Xterm supports AI assistants and language models through dedicated commands:
serial-xterm.ai.sendCommand - Send commands to serial device and get responses
serial-xterm.ai.getCommandResult - Retrieve recent output from serial device
serial-xterm.ai.getConnectionStatus - Check serial connection status
These commands can be used by AI assistants like GitHub Copilot to help you interact with serial devices programmatically.
Word Highlighting
You can configure word highlighting patterns in the Tool menu.
Serial Xterm will highlight matching words in Red, Yellow, or Green colors.