Skip to content

Commit

Permalink
Make the mechanism for escaping discoverable and customizable
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
lif committed May 17, 2023
1 parent 3e1bfb0 commit 2633a39
Show file tree
Hide file tree
Showing 4 changed files with 115 additions and 209 deletions.
93 changes: 69 additions & 24 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ softnpu-lib = { git = "https://github.com/oxidecomputer/softnpu", branch = "main
syn = "1.0"
tempfile = "3.2"
thiserror = "1.0"
thouart = { git = "https://github.com/oxidecomputer/thouart", rev = "656d2a77dd22f7110f513aed2401ebd740b9ef79" }
tokio = "1"
tokio-tungstenite = "0.17"
tokio-util = "0.7"
Expand Down
1 change: 1 addition & 0 deletions bin/propolis-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ propolis-client = { workspace = true, features = ["generated"] }
slog.workspace = true
slog-async.workspace = true
slog-term.workspace = true
thouart.workspace = true
tokio = { workspace = true, features = ["full"] }
tokio-tungstenite.workspace = true
uuid.workspace = true
Expand Down
Loading

0 comments on commit 2633a39

Please sign in to comment.