Rework the color option to support setting ANSI color code values
ranging from 0..255 or "none" for no color or "list" to print a list of
available ANSI colors codes.
Also, disables color when piping.
While in hex mode (ctrl-t h) you can output hexadecimal values.
E.g.: to send 0x0A you have to type 0A (always 2 characters).
Added option -x, --hex to start in hexadecimal mode.
Added option --newline-in-hex to interpret newline characters in hex mode.
This is disabled by default, because, in my opinion, hex stream is
fundamentally different from text, so a "new line" is meaningless in this
context.
Optional arguments, as parsed by the getopt_long mechanism, are
inherently inconsistent with how you define required arguments.
To avoid confusion we decide to avoid this inconsistency by replacing
optional options with additional options with required argmuments.
This allows for better config file ergonomics if the user has a diverse
set of serial devices as the name does not need to be specified in
the config file twice.
This feature allows an external program to inject output into and
listen to input from a serial port via a Unix domain socket (path
specified via the -S/--socket command line flag, or the socket
config file option) while tio is running. This is useful for ad-hoc
scripting of serial port interactions while still permitting manual
control. Since many serial devices (at least on Linux) get confused
when opened by multiple processes, and most commands do not know
how to correctly open a serial device, this allows a more convenient
usage model than directly writing to the device node from an external
program.
Any input from clients connected to the socket is sent on the serial
port as if entered at the terminal where tio is running (except that
ctrl-t sequences are not recognized), and any input from the serial
port is multiplexed to the terminal and all connected clients.
Sockets remain open while the serial port is disconnected, and writes
will block.
Example usage 1 (issue a command):
echo command | nc -UN /path/to/socket > /dev/null
Example usage 2 (use the expect command to script an interaction):
#!/usr/bin/expect -f
set timeout -1
log_user 0
spawn nc -UN /path/to/socket
set uart $spawn_id
send -i $uart "command1\n"
expect -i $uart "prompt> "
send -i $uart "command2\n"
expect -i $uart "prompt> "
Also changes default timestamp format from ISO8601 to classic 24-hour
format as this is assumed to be the format that most users would prefer.
And reintroduces strict but optional ISO8601 format.
This feature allows to easily add more timestamp formats in the future.
Allow user to select which ANSI color code to use to colorize the tio
text. To successfully set the color the color code must be in the range
0..255.
If color code is negative tio will print all available ANSI colors.
The default color is changed to bold white to make tio defaults usable
for most users, including color blind users.
The following new mapping flags are added:
INLCRNL: Map NL to CR-NL on input.
ODELBS: Map DEL to BS on output.
Flags requested and tested by Jan Ciger (janoc).
Add a --map option which allows to map special characters, in particular CR and
NL characters which are used in various combinations on varios platforms.