Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c2915b3a authored by Sonny Sasaka's avatar Sonny Sasaka
Browse files

Floss: Treat ctrl-C as cancelling command instead of exiting

It's common to use ctrl-C to cancel command with readline. Users can
still exit quickly using the ctrl-D shortcut.

Bug: 254870159
Tag: #floss
Test: Ran btclient

Change-Id: I14ac336ec6f9d1964acbed6c99836a1f7ba4716e
parent b73d9729
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -566,6 +566,11 @@ async fn start_interactive_shell(
                print_info!("Adapter {} is ready", adapter_address);
            }
            ForegroundActions::Readline(result) => match result {
                Err(rustyline::error::ReadlineError::Interrupted) => {
                    // Ctrl-C cancels the currently typed line, do nothing and ready to do next
                    // readline again.
                    semaphore_fg.add_permits(1);
                }
                Err(_err) => {
                    break;
                }