Skip to content

Commit 64568bc

Browse files
committed
Apply a temporary fix to the serial monitor to make Ctrl-c work again
1 parent 2e9347d commit 64568bc

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

espflash/src/cli/monitor.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,12 @@ pub fn monitor(mut serial: Box<dyn SerialPort>) -> serialport::Result<()> {
120120
if let Event::Key(key) = read()? {
121121
if key.modifiers.contains(KeyModifiers::CONTROL) {
122122
match key.code {
123-
KeyCode::Char('c') => break,
124-
KeyCode::Char('r') => {
123+
// NOTE: Both the lower- and upper-case variants shouldn't
124+
// need to be matched normally, but there is a bug in
125+
// crossterm 0.23 which requires this fix. See:
126+
// https://github.com/crossterm-rs/crossterm/pull/629
127+
KeyCode::Char('c') | KeyCode::Char('C') => break,
128+
KeyCode::Char('r') | KeyCode::Char('R') => {
125129
serial.write_data_terminal_ready(false)?;
126130
serial.write_request_to_send(true)?;
127131

0 commit comments

Comments
 (0)