This mostly is intended to have local echo output exactly what is sent
to the remote endpoint.
A nice side-effect is, that it also fixes tty-implementations, that can't
deal with the OCRNL flag on tio.c_oflag.
Logfiles are important to see what happend, in particular if something
unexpected happened; so we want to make sure that the logfile is flushed
to disk.
Before this change, the logfile was typically written at the end in
a large chunk as the default (large) buffering applied. Now, characters are
written out ASAP, so it is possible to get a live-view with a
tail -f <logfile>
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).
Support for non-standard baudrate settings will be automatically enabled
if the termios2 interface is detected available. However, to play it
safe, the old and widely supported termios interface will still be used
when setting standard baudrates.
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.
On Fedora 26 tio will quit with the following error message:
"Error: Could not apply new stdout settings (Invalid argument)"
In case of Fedora, it turns out that the new stdout settings used are a
bit too agressive because an empty termios structure is used. To remedy
this we reuse the existing stdout settings and only reconfigure the
specific options we need to make a "raw" stdout configuration.
Fixed the configure script to avoid that the bash completion script gets
installed outside of the prefix location. The default install location
is now $prefix/share/bash-completion/completions.
Use the configure option '--with-bash-completion-dir=PATH' if you need
to install the bash completion script elsewhere.
A new key command 'ctrl-t h' is introduced which toggles between
hexidecial mode and normal mode. When in hexidecimal mode data received
will be printed in hexidecimal.
This reverts commit deec83a4ee.
Reverting because supporting non-standard or arbitrary baud rates is
troublesome because the c library provides no means of doing so and even
if bare metal linux kernel interface is used it will not work on all
Linux kernels version.
Rearranged the key commands:
ctrl-c (clear screen) is now
ctrl-l which is similar to the well known shell ctrl-l
ctrl-i (show settings information) is now
ctrl-c (show configuration)
Updated man page accordingly.
Only enabled when possible, that is, when the BOTHER definition is
available.
It is untested but it should work as described here:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=683826
Some Cypress USB<->serial devices supposedly supports arbitrary speeds.
Support a single source of baud rate configuration as discussed in
https://github.com/tio/tio/issues/45 .
To do so, autogeneration of the switch cases which do the baud rate
option value check and configuration/conversion in tty_configure() is
introduced via a single macro.
Just to be safe, this change also enables configure detection of all
baud rates, including the ones previously assumed supported by most/all
systems (POSIX).
Various platforms supports different baud rates.
To avoid adding platform specific handling generic baud rate detection
tests are introduced in the configure script. Successfully detected baud
rates are automatically enabled. This applies to both the C code and the
bash completion script.
Note:
Baud rates below 57600 are defined by POSIX-1 and supported by most
platforms so only baud rate 57600 and above are tested.