Skip to content

Interactive serial module#282

Open
llogen wants to merge 3 commits into
mainfrom
feat/extendSerialModule
Open

Interactive serial module#282
llogen wants to merge 3 commits into
mainfrom
feat/extendSerialModule

Conversation

@llogen

@llogen llogen commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

Bidirectional serial console to the DUT. Resolves #121 and #119.

Extends the serial module — which already streams output (monitor) and runs scripted expect/send steps on main — with a live, hand-driven console, and makes sessions resilient to the device dropping out.

Client (cmds/dutctl)

Switches the terminal to raw mode for an interactive run, so every keystroke — including Ctrl-C, Ctrl-D and Ctrl-Z — streams straight to the DUT instead of being handled locally. Quit the session with Ctrl-A then x.

Raw mode is armed lazily: only when the run is interactive (invoked without arguments) and the agent actually streams console output — so scripted and one-shot commands (power, flash) leave the terminal untouched. Implemented for Linux and macOS; other platforms (incl. Windows) build with a no-op, line-buffered fallback.

Module (pkg/module/serial)

  • Interactive mode (-i) — bridges the client console to the serial port in both directions, until the session is cancelled or -t elapses.
  • Auto-reconnect (Reconnect serial device automatically #119) — if the serial device disappears mid-session (e.g. an FTDI chip that powers down with the DUT), the module waits for it to reappear and reconnects instead of ending the run. Active in interactive, monitor and expect modes.

Agent (internal/dutagent)

Closes the module's stdin channel on session teardown, so a module blocked reading client input (like the serial console) unblocks via EOF and the command returns cleanly instead of hanging.

This comment was marked as outdated.

@llogen
llogen force-pushed the feat/extendSerialModule branch 2 times, most recently from 9f7f3e0 to 87a4da9 Compare February 18, 2026 10:07
@llogen
llogen requested a review from Copilot February 18, 2026 10:08

This comment was marked as outdated.

This comment was marked as outdated.

This comment was marked as outdated.

This comment was marked as outdated.

This comment was marked as outdated.

This comment was marked as resolved.

@jenstopp jenstopp changed the title feat: make serial module interactive Interactive serial module Mar 16, 2026
@llogen
llogen force-pushed the feat/extendSerialModule branch 3 times, most recently from 8de5449 to 8db5226 Compare June 8, 2026 08:55
@llogen
llogen marked this pull request as ready for review June 8, 2026 08:56
@llogen
llogen force-pushed the feat/extendSerialModule branch 2 times, most recently from d43b406 to fafae49 Compare June 22, 2026 11:50
@llogen
llogen force-pushed the feat/extendSerialModule branch 3 times, most recently from c419eab to 37d4bb7 Compare July 17, 2026 11:07
@llogen
llogen force-pushed the feat/extendSerialModule branch from 37d4bb7 to 0f28b63 Compare July 24, 2026 09:06
llogen added 3 commits July 24, 2026 11:43
The serial module gains three modes - interactive pass-through,
expect (wait for a regex then exit) and expect-send pairs that
auto-reply to prompts - and strips non-SGR terminal sequences from
DUT output so they cannot corrupt the client terminal. If the serial
device disappears mid-session (e.g. an FTDI chip that powers down with
the DUT) it waits for the device to reappear and reconnects
automatically. (#119)

Signed-off-by: llogen <christoph.lange@blindspot.software>
The agent now closes the module stdin channel during session
teardown, so a module blocked reading client input (such as the
serial console) unblocks via EOF and the command returns instead
of hanging.

Signed-off-by: llogen <christoph.lange@blindspot.software>
The client now switches the terminal to raw mode during a run and
forwards every keystroke - including Ctrl-C, Ctrl-D and Ctrl-Z -
straight to the DUT. Press Ctrl-A then x to quit the session. Raw
mode is build-tagged for Linux and macOS, with a no-op fallback on
other platforms so the client still builds everywhere. (#121)

Signed-off-by: llogen <christoph.lange@blindspot.software>
@llogen
llogen force-pushed the feat/extendSerialModule branch from 0f28b63 to 2feba24 Compare July 24, 2026 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement proper consol raw mode on the client

2 participants