flipperzero-rs / flipperzero

Rust on the Flipper Zero
MIT License
518 stars 34 forks source link

serial_cli: capture exit keycode on MacOS terminal #68

Closed mogenson closed 1 year ago

mogenson commented 1 year ago

On MacOS with the default Terminal application, Crossterm reports the Ctrl + ] sequence as Ctrl + 5. The fbt Python tool seems to work fine on MacOS + Terminal app, so this may be a Crossterm quirk.

Capture the Ctrl + 5 keycode and exit process.

dcoles commented 1 year ago

Hi @mogenson. Thanks for the PR!

I honestly not an expert on keyboard mappings, but it seems that in many (most?) terminal keyboard mappings (e.g. US) Ctrl+] and Ctrl+5 both map to Control_bracketright. So it seems like it should be fine to accept either.