Skip to content

Commit 5802f52

Browse files
author
lif
committed
Make the mechanism for escaping discoverable and customizable
This changes the method of entering an escape sequence: - raw Ctrl+C gets sent to the VM unimpeded. - by default, the sequence Ctrl+], Ctrl+C is used to quit the program (`^]^C`) - this can be customized or removed via CLI flags, allowing the string be of arbitrary length. - i.e. if you `propolis-cli serial -e "beans"` and then type "bea", nothing gets sent to the VM after the "b" yet. and then if you type: 1. "k", the VM gets sent "beak" 2. '"ns", the VM doesn't get sent anything else, and the client exits. - the client can be configured to pass through an arbitrary prefix length of the escape string before it starts suppressing inputs, such that you can, for example, mimic ssh's Enter-tilde-dot sequence without temporarily suppressing Enter presses not intended to start an escape sequence, which would interfere with function: `-e '^M~.' --escape-prefix-length=1` (this also works around ANSI escape sequences being sent by xterm-like emulators when Enter is pressed in a shell that sends a request for such) Much of this logic, including RawTermiosGuard, has now been factored out into the https://github.com/oxidecomputer/thouart crate.
1 parent d96051d commit 5802f52

File tree

4 files changed

+115
-209
lines changed

4 files changed

+115
-209
lines changed

Cargo.lock

Lines changed: 69 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ softnpu-lib = { git = "https://github.com/oxidecomputer/softnpu", branch = "main
118118
syn = "1.0"
119119
tempfile = "3.2"
120120
thiserror = "1.0"
121+
thouart = { git = "https://github.com/oxidecomputer/thouart", rev = "656d2a77dd22f7110f513aed2401ebd740b9ef79" }
121122
tokio = "1"
122123
tokio-tungstenite = "0.17"
123124
tokio-util = "0.7"

bin/propolis-cli/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ propolis-client = { workspace = true, features = ["generated"] }
1515
slog.workspace = true
1616
slog-async.workspace = true
1717
slog-term.workspace = true
18+
thouart.workspace = true
1819
tokio = { workspace = true, features = ["full"] }
1920
tokio-tungstenite.workspace = true
2021
uuid.workspace = true

0 commit comments

Comments
 (0)