Commit graph

52 commits

Author SHA1 Message Date
Martin Lund
9a66de0aff Fixed tx/rx counters type 2016-05-21 10:31:41 +02:00
Martin Lund
fa079c6852 Fixed tio_printf macro 2016-05-20 20:49:16 +02:00
Martin Lund
065ee51291 Fixed launch hints
Fixed launch hints not being printed in no autoconnect mode.
2016-05-20 20:19:42 +02:00
Martin Lund
59a537f7dd Added 'ctrl-t ?' to list available commands 2016-05-20 20:10:12 +02:00
Martin Lund
66d5cf5456 Fixed log mechanism
To avoid echoing only log what is received from tty device.
2016-05-20 19:51:12 +02:00
Martin Lund
8ddabb1908 Improved tio output
Added titles and indentation to commands output for clearer separation
when firing commands repeatedly.

Also added print of tio version and quit command hint at launch.
2016-05-20 19:36:23 +02:00
Martin Lund
dc455eb0c2 Merge branch 'master' of github.com:tio/tio 2016-05-20 15:19:46 +02:00
Martin Lund
7eb64748da Cleaned up tio print mechanism 2016-05-20 15:18:48 +02:00
Martin Lund
79adb44d1b Fixed some error prints 2016-05-18 22:27:31 +02:00
Martin Lund
dd49d07547 Fixed error printing for no autoconnect mode
Always print errors but only print silent errors when in no autoconnect
mode.
2016-05-18 21:28:08 +02:00
Martin Lund
ffe87bc566 Added key command for showing session settings
A new key command "ctrl-t i" is added to allow the user to display the
various session settings information (baudrate, databits, log file, etc.).

This is usefull in case you have a running session but have forgotten
what the settings are.
2016-05-18 15:29:09 +02:00
Martin Lund
20c43dcf7c Consolidated command key handling 2016-05-18 09:06:40 +02:00
Martin Lund
13a8bc7790 Moved delay mechanism into separate function 2016-05-18 08:17:07 +02:00
Martin Lund
14fc053e8b Retired obsolete usleep()
Replaced with nanosleep()
2016-05-17 22:21:12 +02:00
Jakub Wilk
dc997b2a8a Insert output delay only if something was output 2016-05-17 22:04:04 +02:00
Martin Lund
a8103b8983 Added simple tx/rx statistics command (ctrl-t s)
To display the total number of bytes transmitted/received simply perform the
'ctrl-t s' command sequence.

This feature can be useful when eg. trying to detect non-printable
characters.
2016-05-17 16:08:19 +02:00
Martin Lund
0687d7ff7b Further simplification of key handling
Changed so that the "ctrl-t ctrl-t" sequence is now simply "ctrl-t t" to
send the ctrl-t key code. This is inspired by screen which does similar
to send its command key code (ctrl-a a).

This change also allows to easier add new key commands if needed.

Updated man page accordingly.
2016-05-17 11:59:56 +02:00
Martin Lund
9571a84d70 Cleaned up and simplified key handling 2016-05-16 22:53:55 +02:00
Martin Lund
156f06c711 Updated tio title 2016-05-16 15:31:56 +02:00
Jakub Wilk
2a03a05a49 Treat EOF on stdin as error 2016-05-13 20:41:39 +02:00
Martin Lund
ef98fc7fa2 Introduced lock on device file
Tio will now test for and obtain an advisory lock on the tty device file
to prevent starting multiple sessions on the same tty device.
2016-05-12 15:44:59 +02:00
Jakub Wilk
bfe5c07279 Fix error handling for select()
Previously the error handling code for select() was unreachable.
2016-05-09 22:17:06 +02:00
Martin Lund
ad551b363e Cleanup of error handling
Introduced consistent way of handling errors and printing error messages.

Also upgraded some warnings to errors.
2016-05-09 17:28:43 +02:00
Martin Lund
3c5cc029a8 Cleanup 2016-05-09 01:04:30 +02:00
Jakub Wilk
2036b1ebe8 Fixed setting "tainted"
Set "tainted" if and only if any character was read from the device.

Ctrl-t is no longer sent to the device on exit, so the trick to avoid
its echo is not necessary.

Characters read from stdin don't directly affect output, so they
shouldn't enable "tainted".
2016-05-08 22:47:53 +02:00
Jakub Wilk
3e1f0e9198 Added missing \r\n to warning messages
\n alone is not enough, because the terminal is in raw mode.
2016-05-08 21:32:59 +02:00
Martin Lund
7c493d957c Fixed index error wrt ctrl-t detection 2016-05-08 13:18:02 +02:00
Martin Lund
755ac53553 Fixed handling of ctrl-t
Before, when exercising the quit key sequence (ctrl-t + q) the ctrl-t code
(0x14) would be sent.

This is now fixed so that it is not sent.

However, in case it is needed to send ctrl-t to the device it is possible by
simply repeating the ctrl-t.

Meaning, ctrl-t + ctrl-t = ctrl-t sent to device.
2016-05-08 11:39:34 +02:00
Martin Lund
ece9e7f918 Improved error handling
Fixes a memory leak and avoids aggressive busy looping when problems
accessing tty device.
2016-05-08 00:37:27 +02:00
Jakub Wilk
05b6a554d3 Completed the ^g to ^t transition
In 72a287f189 the escape key was changed from ^g to ^t, but some
code and comments still referred to the old key.
2016-05-07 21:00:05 +02:00
Martin Lund
72a287f189 Changed escape key from ^g to ^t
After renaming to "tio" it makes sense to change the escape key
accordingly. Hence, the new escape key is ^t.

Meaning, in session, its now ctrl-t + q to quit.
2016-05-07 14:31:24 +02:00
Martin Lund
9dd21af867 Renamed "gotty" to "tio"
Renamed to "tio" because it is shorter and this new name also more
precisely reflects what the program is - a simple TTY terminal I/O
application.

"tio" can be considered short for terminal I/O or TTY I/O or a
combination of the two, whichever you prefer.

Also, wanted to avoid naming conflicts with other projects.
2016-05-04 20:20:06 +02:00
Martin Lund
bbda0b8851 Added log feature
Added "--log <filename>" option which writes all activity to specified
file.
2016-05-01 21:21:05 +02:00
Martin Lund
ebd65400a1 Fix tty device file accessibility test
Fixes ending up in a freeze when a tty device exists but is not
readable.
2016-04-25 15:31:49 +02:00
Martin Lund
9f38512285 Do not quit on error
This makes gotty more robust in the sense it will not quit when an error
occurs but simply continue to try reconnect.
2016-04-24 15:43:56 +02:00
Martin Lund
c6c4a4b1dd Minor cleanup 2016-04-24 09:20:27 +02:00
Jakub Wilk
97c896d52b Fixed typo 2016-04-23 22:21:38 +02:00
Martin Lund
4eaff1df9d Renamed --char-delay to --output-delay
Renaming to make the naming more specific for the feature.
2015-04-18 11:41:49 +03:00
Jeppe Ledet-Pedersen
bc100643ec Add option for setting inter-character delay 2015-04-13 13:45:05 +02:00
Martin Lund
7bef8f8a0d Flush I/O data on connect
Make sure there is no stale I/O data on tty device upon connect.
2014-10-23 11:20:48 +02:00
Martin Lund
0ad8007aac Eliminated first time connect delay
Rearranged timeout handling so that the first time connect delay is
eliminated.
2014-10-12 18:33:53 +02:00
Martin Lund
2cf211b99f Changed quit key sequence to ctrl-g + q
Changed the quit key sequence from ctrl-g + ctrl-q to ctrl-g + q as the
latter is simpler and considered more conventional.
2014-10-08 19:25:35 +02:00
Martin Lund
b6c1135d69 Added timestamp to gotty prompt 2014-10-07 17:45:21 +02:00
Martin Lund
cc7f21e735 Various cleanup
Renamed device -> tty_device.

Removed hardcoded tty device name max length.

Updated README.
2014-09-30 16:05:38 +02:00
Martin Lund
820b990692 Renamed stdio to new_stdout
Since it is actually only stdout we configure.
2014-09-30 01:31:55 +02:00
Martin Lund
9dfb1debaf Fixed disconnect output
In certain cases the disconnect message would eat a line of output from
the tty device (if any). This is now fixed.
2014-09-30 01:18:29 +02:00
Martin Lund
4b535a5c62 Improved Connected / Disconnected output 2014-09-28 12:59:00 +02:00
Martin Lund
960d59cbc4 Improved error output 2014-09-28 12:09:19 +02:00
Martin Lund
6e2582787c Fixed not being able to quit
When gotty was waiting for a device to appear it was impossible to quit
using the ctrl-g ctrl-q sequence. This is now fixed.
2014-09-27 22:18:07 +02:00
Martin Lund
57beed2e34 Cleanup of stdin handle 2014-09-27 21:44:40 +02:00