Line editing.

The program can be started in line editing mode. In this mode, the
current line can be edited by inserting/deleting characters. Escape
values can be used for bytes.

Controls:
    printable   - adds character to the position of the cursor
    RIGHT, LEFT - moves cursor in the line
    UP, DOWN    - gets prevoiusly sent lines from the history
    BACKSPACE   - deletes character before the cursor
    ENTER       - sends line

Commands:
    :?          - list available commands
    :q          - quit
    :v          - show version
    ::          - send ':'

Escapes:
    \dNNN       - decimal NNN       (e.g: \d045      = 45)
    \xNN        - hexadecimal NN    (e.g: \xff       = 255)
    \bNNNNNNNN  - binary NNNNNNNN   (e.g: \b00000001 = 1)

Added option --line-edit, to start the program in line editing mode.
Added option --no-newline-in-line-edit to prevent sending newline
characters.
This commit is contained in:
g0mb4 2021-07-29 15:59:27 +02:00
parent 7fc8e278ed
commit aa9f6435db
10 changed files with 730 additions and 195 deletions

View file

@ -12,7 +12,9 @@ tio_SOURCES = tty.c \
include/tio/time.h \
include/tio/print.h \
include/tio/log.h \
include/tio/error.h
include/tio/error.h \
lineedit.c \
include/tio/lineedit.h
if ADD_SETSPEED2
tio_SOURCES += setspeed2.c