console: re-use the available REPL console API and improve linenoise

Console example doesn't duplicate code in `console` component.
Linenoise has been improved: it now has a parametrized command line
length. It is now possible to paste data efficiently to the console.
Note: this can only be done if the cursor is at the end of the line.

Closes https://github.com/espressif/esp-idf/issues/7057
This commit is contained in:
Omar Chebib
2021-07-15 11:37:11 +08:00
committed by Zim Kalinowski
parent da3038cd7a
commit 0fd74a43c8
53 changed files with 617 additions and 27 deletions

View File

@@ -39,6 +39,9 @@ Linenoise library does not need explicit initialization. However, some configura
:cpp:func:`linenoiseAllowEmpty`
Set whether linenoise library will return a zero-length string (if ``true``) or ``NULL`` (if ``false``) for empty lines. By default, zero-length strings are returned.
:cpp:func:`linenoiseSetMaxLineLen`
Set maximum length of the line for linenoise library. Default length is 4096. If you need optimize RAM memory usage, you can do it by this function by setting a value less than default 4kB.
Main loop
^^^^^^^^^