Skip to main content

Testing & Automation

MonoTerm has two interfaces for automation: test for UI verification and ctl for controlling a running instance.

monoterm test

Spawns a fresh MonoTerm in a real pseudo-terminal and sends keystrokes through the same path as a human typing. Use this to verify UI features.
monoterm test              # run automated test suite
monoterm test spawn        # start and show initial screen
monoterm test key @        # send @ key, show resulting screen
monoterm test key tab      # send Tab key
monoterm test key ctrl+b   # send Ctrl+B
Example: verify prompt box opens
$ monoterm test key @

Screen after '@':
   0:  FILES
   1: src/
   2: main.rs
   3: lib.rs
   9: Cargo.toml     ┌─ Prompt ──────────────┐
  10: README.md Type or / for commands
  14:     └────────────────────────┘
Automated suite runs 10 checks:
$ monoterm test

--- Prompt Box (@) ---
  PASS  Prompt visible
  PASS  FILES visible

--- Tab to tree ---
  PASS  Enter:insert hint

--- Tree search ---
  PASS  search bar / lib

--- Tab back to prompt ---
  PASS  Tab:files hint

--- Type in prompt ---
  PASS  hello in prompt
  PASS  hello NOT in search

--- Esc close ---
  PASS  Prompt gone

8/10 passed

monoterm ctl

Controls a running MonoTerm instance via Unix socket. Connects automatically to the newest instance.
monoterm ctl status              # instance info
monoterm ctl tabs                # list all tabs
monoterm ctl read                # read screen content
monoterm ctl run 'ls -la'        # execute command in active tab
monoterm ctl write 'partial'     # send text without Enter
monoterm ctl ctrl-c              # send interrupt signal
Example: run a command and read output
$ monoterm ctl run 'echo hello'
ok

$ monoterm ctl read hello
hello
macbook@NIIA ~ %

When to use which

testctl
TargetNew instanceRunning instance
KeysThrough keyboard layerDirect to shell
Best forUI verificationShell automation
Speed~10s startupInstant