Skip to content

feat(cli): Allow resize handling configuration#86

Merged
finger563 merged 1 commit intomainfrom
feature/cli
Jul 11, 2023
Merged

feat(cli): Allow resize handling configuration#86
finger563 merged 1 commit intomainfrom
feature/cli

Conversation

@finger563
Copy link
Contributor

Description

  • Update to allow users to specify whether they want the lineinput / cli to attempt to handle resize events automatically or not
  • Fixed bug where get_cursor_position / get_terminal_size response information (used by scanf) would get entered into the lineinput and cause unusable bugs X.X
  • rebuild docs

Motivation and Context

There was a bug in the cli when handling resize events (which could be triggered by pressing and holding enter as well) which caused input that was intended for scanf to be handled as user input which would result in a positive feedback loop and render the terminal unusable. This fix properly discards all control sequences that are not explicitly asked for in the control sequence switch statement default case.

Additionally, to help future unforeseen bugs that may stem from the resize functionality, I've added an API to the cli and line input classes to allow the user to turn off the automatic handling of terminal resize.

Also updated some of the class documentation to help inform users of these conditions and what to do if they arise.

How has this been tested?

Building and running the cli example

Screenshots (if appropriate, e.g. schematic, board, console logs, lab pictures):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update
  • Hardware (schematic, board, system design) change
  • Software change

Checklist:

  • My change requires a change to the documentation.
  • I have added / updated the documentation related to this change via either README or WIKI

Software

  • I have added tests to cover my changes.
  • I have updated the .github/workflows/build.yml file to add my new test to the automated cloud build github action.
  • All new and existing tests passed.
  • My code follows the code style of this project.

* Update to allow users to specify whether they want the lineinput / cli to attempt to handle resize events automatically or not
* Fixed bug where get_cursor_position / get_terminal_size response information (used by scanf) would get entered into the lineinput and cause unusable bugs X.X
* rebuild docs
@finger563 finger563 added bug Something isn't working enhancement New feature or request cli labels Jul 11, 2023
@finger563 finger563 merged commit 71d49c6 into main Jul 11, 2023
@finger563 finger563 deleted the feature/cli branch July 11, 2023 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working cli enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant