Skip to main content
The serial command opens a serial port connection, allowing you to interact with serial devices directly from WezTerm.

Synopsis

wezterm serial [OPTIONS] <PORT>

Description

Opens a connection to a serial port device. This is useful for interacting with embedded systems, microcontrollers, network equipment, and other hardware that communicates via serial interfaces.

Arguments

PORT
string
required
Specifies the serial device name.
  • Windows: Use names like COM0, COM1, COM2, etc.
  • Linux/Unix: Use device paths like /dev/ttyUSB0, /dev/ttyACM0, /dev/ttyS0, etc.
  • macOS: Use device paths like /dev/cu.usbserial-1234, /dev/tty.usbserial-1234, etc.
Examples:
# Windows
wezterm serial COM3

# Linux
wezterm serial /dev/ttyUSB0

# macOS
wezterm serial /dev/cu.usbserial-1234

Options

--baud
number
Set the baud rate. The default is 9600 baud.Common baud rates: 9600, 19200, 38400, 57600, 115200Example:
wezterm serial --baud 115200 /dev/ttyUSB0
--class
string
Override the default windowing system class. The default is org.wezfurlong.wezterm.
  • Under X11 and Windows: changes the window class
  • Under Wayland: changes the app_id
This changes the class for all windows spawned by this instance of wezterm, including error, update and ssh authentication dialogs.
--position
string
Override the position for the initial window launched by this process.Format options:
  • --position 10,20 - set x=10, y=20 in screen coordinates
  • --position screen:10,20 - set x=10, y=20 in screen coordinates
  • --position main:10,20 - set x=10, y=20 relative to the main monitor
  • --position active:10,20 - set x=10, y=20 relative to the active monitor
  • --position HDMI-1:10,20 - set x=10, y=20 relative to the monitor named HDMI-1

Examples

Connect with default baud rate (9600)

# Linux
wezterm serial /dev/ttyUSB0

# Windows
wezterm serial COM3

Connect with 115200 baud

wezterm serial --baud 115200 /dev/ttyUSB0

Arduino serial connection

# Linux
wezterm serial --baud 9600 /dev/ttyACM0

# macOS
wezterm serial --baud 9600 /dev/cu.usbmodem14101

Embedded development board

wezterm serial --baud 115200 /dev/ttyUSB0

Network equipment console

wezterm serial --baud 9600 /dev/ttyUSB0

Finding Serial Ports

Linux

List available serial ports:
ls /dev/tty*
# Look for ttyUSB*, ttyACM*, ttyS*
Or use:
dmesg | grep tty

macOS

List available serial ports:
ls /dev/cu.*
ls /dev/tty.*

Windows

Check Device Manager or use PowerShell:
[System.IO.Ports.SerialPort]::getportnames()

Common Use Cases

  • Arduino/Microcontroller Development: Connect to Arduino boards or other microcontrollers for programming and debugging
  • Embedded Systems: Interact with embedded Linux systems via serial console
  • Network Equipment: Access console ports on routers, switches, and other network devices
  • Debugging: Monitor serial output from hardware devices
  • IoT Devices: Communicate with IoT hardware during development

Tips

  • On Linux, you may need to add your user to the dialout group to access serial ports:
    sudo usermod -a -G dialout $USER
    
    (Log out and back in for changes to take effect)
  • Some devices require specific baud rates. Check your device documentation.
  • Use Ctrl+C to send interrupt signals to the connected device