flipperdevices / flipperzero-ufbt

Compact tool for building and debugging applications for Flipper Zero.
https://pypi.org/project/ufbt/
GNU General Public License v3.0
600 stars 40 forks source link

No way to exit from "ufbt cli" #44

Closed AlexTaran closed 7 months ago

AlexTaran commented 7 months ago

Not sure if it's an issue in firmware or ufbt itself, but after running "ufbt cli" there's no way to exit it except rebooting flipper.

There are no commands like "exit" or "quit", ctrl-D does not work. There's also no such command in the list of commands (pressing "help" or "?").

Killing ufbt process ("sudo killall ufbt") also does not help - it's not possible to run "sudo ufbt launch" after it because it prints:

2024-04-28 14:55:13,663 [ERROR] Error: device reports readiness to read but returned no data (device disconnected or multiple access on port?)
scons: *** [phony_launch] Error 4

After flipper reboot everything is OK.

Is there any way to safely exit from "ufbt cli". If so, could this be added to documentation?

hedger commented 7 months ago

There's no CLI command for that, because terminating CLI session is performed by closing the port. That must be done by the app that opened it, not by the device.

Also, if you read the output on session start, you'd see the shortcut for closing the terminal.

$ ufbt cli
scons: Entering directory `/Users/hedger/.ufbt/current/scripts/ufbt'

fbt: warning: App folder '/Users/hedger': missing manifest (application.fam)
LoadAppManifest, line 130, in file "/Users/hedger/.ufbt/current/scripts/fbt_tools/fbt_apps.py"
python3 /Users/hedger/.ufbt/current/scripts/serial_cli.py -p auto
--- Miniterm on /dev/cu.usbmodemflip_Ayoo1  230400,8,N,1 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---

That's Ctrl+].