Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FL-3909] CLI improvements, part I #3928

Merged
merged 10 commits into from
Oct 14, 2024
Merged

Conversation

portasynthinca3
Copy link
Member

@portasynthinca3 portasynthinca3 commented Oct 2, 2024

What's new

  • Better internal ANSI escape sequence handling
  • Colors!
  • New command input shortcuts:
    • to clear the input
    • Ctrl + and Ctrl + to skip a word
    • Ctrl + Backspace to clear a word
    • Home and End to move the cursor to the start and the end of the input
  • Fixed blinking top command

Verification

  • Open the CLI and verify that the shortcuts mentioned above all work as expected
  • Verify that the MOTD now has colors
  • Verify that the top command does not visibly clear the entire screen when it refreshes
  • Verify that qFlipper, Flipper Labs and the VGM are still able to open an RPC session
  • Verify that fbt is still able to upload files

Remarks

I originally wanted to utilize escape sequences in the console prompt, but it seems like qFlipper does not like them and gets stuck in a loading state whenever the device is connected. Both Labs and fbt deal with a colored >: prompt just fine. I have not tested this with any expansion modules and decided to keep it as-is for now.

Checklist (For Reviewer)

  • PR has description of feature/bug or link to Confluence/Jira task
  • Description contains actions to verify feature/bugfix
  • I've built this code, uploaded it to the device and verified feature/bugfix

Copy link

github-actions bot commented Oct 2, 2024

Compiled f7 firmware for commit 4e21aeb2:

Copy link

github-actions bot commented Oct 6, 2024

PVS-Studio report for commit dc5295ff:

applications/services/cli/cli.c Outdated Show resolved Hide resolved
applications/services/cli/cli.c Outdated Show resolved Hide resolved
@skotopes skotopes marked this pull request as draft October 6, 2024 20:38
@portasynthinca3 portasynthinca3 marked this pull request as ready for review October 7, 2024 11:06
@skotopes skotopes marked this pull request as draft October 14, 2024 13:56
@skotopes
Copy link
Member

undraft when ready

@portasynthinca3 portasynthinca3 marked this pull request as ready for review October 14, 2024 14:06
@skotopes skotopes merged commit 0f83141 into dev Oct 14, 2024
11 checks passed
@skotopes skotopes deleted the portasynthinca3/3909-cli-ansi-codes branch October 14, 2024 14:50
RogueMaster pushed a commit to RogueMaster/flipperzero-firmware-wPlugins that referenced this pull request Oct 15, 2024
* fix: cli top blinking
* feat: clear prompt on down key
* feat: proper-er ansi escape sequence handling
* ci: fix compact build error
* Make PVS happy
* style: remove magic numbers
* style: review suggestions

Co-authored-by: あく <[email protected]>
portasynthinca3 added a commit that referenced this pull request Oct 16, 2024
RogueMaster added a commit to RogueMaster/flipperzero-firmware-wPlugins that referenced this pull request Oct 16, 2024
skotopes added a commit that referenced this pull request Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants