Commit graph

342 commits

Author SHA1 Message Date
Martin Lund
39a8f63640 Add command to show version
The key sequence ctrl-t v will now show the version of tio.
2018-11-27 23:56:34 +01:00
Martin Lund
42eb14dd77 Align format of timestamps 2018-11-27 23:38:21 +01:00
Mariusz Midor
18c2f7847e Newline: handle booth NL and CR
Flag ONLCRNL expects code \n after press Enter, but on some systems \r is send instead.
2018-11-12 19:16:51 +01:00
Martin Lund
a5d1546024 Minor code style cleanups 2018-11-03 16:40:59 +01:00
Robey Pointer
f96ad43b1f add optional timestamps
with "-t" or "C-t T", toggle a timestamp prefix to each line.
2018-11-01 17:23:57 -07:00
Martin Lund
36691e8bdf Cleanup print macros 2018-10-21 02:14:18 +02:00
Martin Lund
14e70bd718 Flush output
Make sure output is transmitted immediately by flushing the output.
2018-10-21 02:07:55 +02:00
Sylvain LAFRASSE
3a024ca529 Made O_NONBLOCK flag to open() call specific to macOS only. 2018-09-04 20:56:21 +02:00
Sylvain LAFRASSE
424c816118 Added O_NONBLOCK flag to open() call for macOS (10.13.6) compatibility. 2018-08-31 13:13:58 +02:00
Martin Lund
7245cdf240 Update date 2018-06-26 18:58:20 +02:00
Martin Lund
0f17e7e0b0
Merge pull request #73 from hzeller/nicer-variables
Clarify the input/output variable names (No-op change)
2018-06-24 16:41:49 +02:00
Martin Lund
8e1e0c9b26
Merge pull request #71 from hzeller/local-echo
Provide local-echo option.
2018-06-24 16:31:21 +02:00
Henner Zeller
9965062fe2 Clarify the input/output variable names (No-op change) 2018-06-24 07:00:17 -07:00
Henner Zeller
776284e251 Organize options the same sequence they are mentiond in cmdline help. 2018-06-24 06:50:05 -07:00
Martin Lund
64f9f3a248
Merge pull request #72 from hzeller/cr-nl
Map CR->NL locally on output instead of using tio.c_oflag |= OCRNL.
2018-06-24 13:17:05 +02:00
Henner Zeller
ab451a984c Map CR->NL locally on output instead of using tio.c_oflag |= OCRNL.
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.
2018-06-23 13:47:06 -07:00
Henner Zeller
dabd2130a9 Provide local-echo option.
Can be switched on with -e on the command line.
Can be toggled with Ctrl t e while program is running.
2018-06-23 12:37:40 -07:00
Henner Zeller
763a09e172 Write to logfile as soon as we have the data, don't buffer.
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>
2018-06-23 11:42:23 -07:00
Martin Lund
b7cdbec8e2 Update man page and bash completion 2018-04-18 20:48:04 +02:00
qianfan Zhao
58456a7636 ONLCRNL: change the method to map NL to CR-NL
Signed-off-by: qianfan Zhao <qianfanguijin@163.com>
2018-04-18 16:25:59 +08:00
Martin Lund
77c19ff152 Add mapping flags INLCRNL and ODELBS
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).
2017-12-29 14:54:40 +01:00
Petr Vaněk
3306a8dfb1 Add missing header file under musl-libc
Musl's inclusion tree slightly differs from glibc, therefore TCGETS2 is
not reachable through sys/ioctl.h, so asm/ioctls.h needs to be included
too.
2017-11-27 14:27:28 +01:00
Martin Lund
59d4604ce6 Add missing header 2017-11-14 21:38:22 +01:00
Martin Lund
e646c50019 Add support for setting non-standard baudrates
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.
2017-11-13 13:40:15 +01:00
Martin Lund
39ef771e10 Cleanup 2017-11-09 14:38:50 +01:00
Martin Lund
342a247efb Reconfigure stdin
Make stdin behave more raw'ish. In particular, don't
translate CR -> NL on input.
2017-11-06 14:43:56 +01:00
Martin Lund
b2aafd696b Add special character map feature
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.
2017-11-05 23:10:12 +01:00
Martin Lund
078bb6213d Cleanup 2017-11-02 16:22:24 +01:00
Martin Lund
288a88aa15 Fix error applying new stdout settings
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.
2017-10-15 23:15:49 +02:00
Martin Lund
29289c8585 Code cleanup
Remove unused variable.
2017-10-01 18:32:34 +02:00
Martin Lund
07255c94b9 Optimize clear screen command
Replaced system call with inline ANSI/VT100 clear screen code sequence
2017-10-01 09:51:29 +02:00
Martin Lund
9c7e4ba06e Fix bash completion installation
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.
2017-10-01 00:11:31 +02:00
Martin Lund
f5e6c99721 Update copyright headers 2017-09-28 18:15:07 +02:00
Jakub Wilk
45bab702f4 Fix typos 2017-09-28 17:13:15 +02:00
Martin Lund
ab512c8f68 Update copyright year 2017-09-24 22:16:19 +02:00
Martin Lund
c257126a33 Code cleanup 2017-09-24 22:09:46 +02:00
Martin Lund
3457446a04 Add support for hexidecimal mode
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.
2017-09-19 12:19:17 +02:00
Martin Lund
7ae62d6030 Add missing forward flag 2017-05-25 17:05:20 +02:00
Adam Borowski
74a543b263 'ctrl-t b' to send serial break. 2017-04-10 01:05:40 +02:00
Martin Lund
8f7c32e2e9 Do no distribute src/bash_completion/tio
Since bash completion tio script is now autogenerated from tio.in it
should not be distributed in the tarball.
2016-06-13 08:23:32 +02:00
Martin Lund
80cd28bbb6 Added more error handling of terminal calls
Also removed duplicate terminal flushing calls.
2016-06-10 18:09:15 +02:00
Martin Lund
61655faaa8 Revert "Added support for non-standard baud rates"
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.
2016-06-10 16:51:12 +02:00
Martin Lund
a64d1a493b Rearranged key commands
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.
2016-06-04 21:56:53 +02:00
Martin Lund
b9a2f4a1be Added "ctrl-t c" key command to clear screen 2016-06-02 00:35:19 +02:00
Martin Lund
deec83a4ee Added support for non-standard baud rates
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.
2016-05-28 16:02:21 +02:00
Martin Lund
c8a677e3d9 Generate baudrate switch cases based on detection
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).
2016-05-28 09:54:45 +02:00
Martin Lund
86eec26b5b Minor cleanup 2016-05-27 09:30:23 +02:00
Martin Lund
bf1f712e5e Exit when not a tty device in autoconnect mode 2016-05-26 17:15:08 +02:00
Martin Lund
72b200a19b Compacted tty_configure() a bit 2016-05-26 16:05:57 +02:00
Jakub Wilk
0f02e6e551 Generated bash completion at configure time 2016-05-26 15:23:19 +02:00