bevy-console icon indicating copy to clipboard operation
bevy-console copied to clipboard

add tab-autocompletion, clear line with ctrl+c, fix minor bug

Open Satellile opened this issue 11 months ago • 2 comments

  • Pressing tab completes the rest of the command. Continuing to press tab cycles through other potential completions. e.g. typing he and pressing tab results in help. If there's another command called heat, pressing tab again could result in heat.
  • Via a new ConsoleConfiguration field, users can manually add autocompletion for command arguments. e.g. after setting up the config, you could type set_color tur and pressing tab results in set_color turquoise
  • Pressing Ctrl + C clears the current line
  • Fix the bug where an "L" is printed onto the console line when clearing the console history with Ctrl + L

The autocompletion code is functional but a bit verbose and messy. It annoyingly doesn't move the text cursor to the end of the line after autocompleting, I wasn't sure how to fix that, but it didn't bother me enough to try to figure it out.

I don't use github often so I'm unfamiliar with pull request etiquette, sorry if I put too many changes into a single pull request. I can try to make multiple pull requests for the individual changes if needed.

Satellile avatar Mar 27 '24 04:03 Satellile