Skip to content

RTT console: add --line-mode for line-buffered input - #2022

Open
ccattuto wants to merge 1 commit into
pyocd:mainfrom
ccattuto:main
Open

RTT console: add --line-mode for line-buffered input#2022
ccattuto wants to merge 1 commit into
pyocd:mainfrom
ccattuto:main

Conversation

@ccattuto

Copy link
Copy Markdown
Contributor

The RTT viewer puts the terminal into raw mode (~ICANON & ~ECHO) and
forwards every keystroke to the target's down buffer as it is typed.
A target that parses line-based commands therefore sees each partially
typed line and acts on it, often resulting in errors.

Add an -l/--line-mode option that buffers the line on the host and
submits it only when Enter is pressed. Backspace/delete and ctrl-U edit
the pending line, and the line is terminated with whichever of CR or LF
the user actually typed.

The flag is off by default, so that targets driven by single keystrokes keep
working unchanged. When it is off, the bytes written to the down buffer and
the characters echoed locally are identical to before.

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.

1 participant