]> git.sur5r.net Git - tio/commitdiff
New upstream version 1.24 upstream/1.24
authorJakob Haufe <sur5r@sur5r.net>
Sun, 8 Oct 2017 14:21:18 +0000 (16:21 +0200)
committerJakob Haufe <sur5r@sur5r.net>
Sun, 8 Oct 2017 14:21:18 +0000 (16:21 +0200)
23 files changed:
AUTHORS
ChangeLog
Makefile.in
README
configure
configure.ac
man/Makefile.in
man/tio.1
src/Makefile.am
src/Makefile.in
src/bash-completion/tio [deleted file]
src/error.c
src/include/tio/error.h
src/include/tio/log.h
src/include/tio/options.h
src/include/tio/print.h
src/include/tio/time.h
src/include/tio/tty.h
src/log.c
src/main.c
src/options.c
src/time.c
src/tty.c

diff --git a/AUTHORS b/AUTHORS
index 1c6fb9c6dd051899201f457e198c7efe3fcaaf72..5d44e15d8d937f35d24a058a37101b0786f2c725 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -8,5 +8,6 @@ Jakob Haufe <sur5r@sur5r.net>
 Jakub Wilk <jwilk@jwilk.net>
 Martin Hundeboll <martin@hundeboll.net>
 Nick Ã˜stergaard <oe.nick@gmail.com>
+Adam Borowski <kilobyte@angband.pl>
 
 Thanks to everyone who has contributed to this project.
index 960e020a7947c2cd6b555bc764de87d1bc7019a9..2fd615802d6fb668d28acd191e470f3c04307efa 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,82 @@
 
-=== tio v1.20 ===
+=== tio v1.24 ===
+
+
+Changes since tio v1.23:
+
+ * Optimize clear screen command
+
+   Replaced system call with inline ANSI/VT100 clear screen code sequence
+
+ * 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.
+
+Jakub Wilk:
+
+ * Add missing commas in conditional sentences
+
+
+
+Changes since tio v1.22:
+
+ * Update copyright headers
+
+Jakub Wilk:
+
+ * Fix typos
+
+
+Changes since tio v1.21:
+
+ * Update man page date
+
+ * Update copyright year
+
+ * Code cleanup
+
+ * Update README and man page
+
+
+
+Changes since tio v1.20:
+
+ * Add support for hexadecimal mode
+
+   A new key command 'ctrl-t h' is introduced which toggles between
+   hexadecimal mode and normal mode. When in hexadecimal mode data received
+   will be printed in hexadecimal.
+
+ * Do not distribute src/bash_completion/tio
+
+   Since the bash completion tio script is now autogenerated from tio.in it
+   should not be distributed in the tarball.
+
+ * Add missing forward flag
+
+ * Update AUTHORS file
+
+Adam Borowski:
+
+ * 'ctrl-t b' to send serial break.
+
+Jakub Wilk:
+
+ * Removed git commit references from ChangeLog
+
+   ChangeLog is primary useful for users who don't have the git repository
+   at hand.
+
+   Replace git commit references with version numbers; or if the change
+   only cleans up another change with no release in between, remove the
+   changelog item completely.
+
+
 
 Changes since tio v1.19:
 
@@ -9,7 +86,7 @@ Changes since tio v1.19:
 
  * Revert "Added support for non-standard baud rates"
 
-   This reverts commit deec83a4eeddd5c3b2d4df041aede2bceb8867da.
+   This reverts a change made in v1.18.
 
    Reverting because supporting non-standard or arbitrary baud rates is
    troublesome because the c library provides no means of doing so and even
@@ -151,15 +228,8 @@ Jakob Haufe:
 
  * Include config.h before standard headers
 
-   This makes use of 8d6d202 (Enable large file support) for real.
-
-Jakub Wilk:
-
- * Fixed printf directives for tx/rx counters
-
-   In 9a66de0affda, types of tx/rx counters were changed from "long" to
-   "unsigned long", but their printf directives remained "%ld".
-   Change them to "%lu" to match the actual types.
+   Large file support was meant to be enabled in v1.11.
+   This change enables it for real.
 
 
 
@@ -363,7 +433,7 @@ Jakub Wilk:
 
  * Completed the ^g to ^t transition
 
-   In 72a287f18995 the escape key was changed from ^g to ^t, but some
+   In v1.7 the escape key was changed from ^g to ^t, but some
    code and comments still referred to the old key.
 
  * Used HTTPS for tio.github.io
index 44e7ced03864fbb62f65944b1d0504e2bbffa43d..1269ba9866180693ceddbece2cb10015b01d0c95 100644 (file)
@@ -207,9 +207,7 @@ AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
-BASH_COMPLETION_CFLAGS = @BASH_COMPLETION_CFLAGS@
 BASH_COMPLETION_DIR = @BASH_COMPLETION_DIR@
-BASH_COMPLETION_LIBS = @BASH_COMPLETION_LIBS@
 BAUDRATES = @BAUDRATES@
 BAUDRATE_CASES = @BAUDRATE_CASES@
 CC = @CC@
diff --git a/README b/README
index 7438f11f13211f676b85a425648401ffe5c4d7e4..20c161f0bd3c3d5c8b09708b50f002e17385b5d3 100644 (file)
--- a/README
+++ b/README
@@ -1,4 +1,6 @@
-=== tio - a simple TTY terminal I/O application ===
+################################################################################
+################# tio - a simple TTY terminal I/O application ##################
+################################################################################
 
 
 1. Introduction
     --no-autoconnect option.
 
     By default tio automatically connects to the provided device if present.
-    If the device is not present it will wait for it to appear and then
-    connect. If the connection is lost (eg. device disconnects) it will wait
+    If the device is not present, it will wait for it to appear and then
+    connect. If the connection is lost (eg. device disconnects), it will wait
     for the device to reappear and then reconnect.
 
-    However, if the --no-autoconnect option is provided tio will exit if the
-    device is not present or exit if an established connection is lost.
+    However, if the --no-autoconnect option is provided, tio will exit if the
+    device is not present or an established connection is lost.
 
     Tio features full bash autocompletion support.
 
+    Tio also supports various key commands. Press ctrl-t ? to list the
+    available key commands.
+
+    See the tio man page for more details.
 
-3. Download
 
-    Find the latest release tarball at https://tio.github.io
+3. Download
 
-    The latest source is available on GitHub: https://github.com/tio/tio
+    The latest release tarball is available at https://tio.github.io
 
 
 4. Installation
 
-    Install steps:
+    Installation steps (from source):
 
     $ ./configure
     $ make
     $ make install
 
-    See INSTALL file for installation details.
+    See INSTALL file for more installation details.
+
+
+    Installation steps (binary package):
+
+    Tio comes prepackaged for various GNU/Linux distributions. Visit
+    https://tio.github.io to see package installation details.
 
 
 5. Contributing
 
     Tio is open source. Any contributions (bug fixes, doc, ideas, etc.) are
-    welcome.
+    welcome. Visit the tio GitHub page to access latest source code, create
+    pull requests, add issues etc..
+
+    GitHub: https://github.com/tio/tio
 
 
 6. Support
 
-    Submit bug reports on GitHub: https://github.com/tio/tio/issues
+    Submit bug reports via GitHub: https://github.com/tio/tio/issues
 
 
 7. License
index 1a07e8ddcbbed097c7313fce73f4a8bce32b0d20..5a0bd8e036dbf3197e1b3970fb9db0a3c78cc929 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for tio 1.20.
+# Generated by GNU Autoconf 2.69 for tio 1.24.
 #
 #
 # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -576,8 +576,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='tio'
 PACKAGE_TARNAME='tio'
-PACKAGE_VERSION='1.20'
-PACKAGE_STRING='tio 1.20'
+PACKAGE_VERSION='1.24'
+PACKAGE_STRING='tio 1.24'
 PACKAGE_BUGREPORT=''
 PACKAGE_URL='https://tio.github.io'
 
@@ -590,8 +590,6 @@ BAUDRATES
 ENABLE_BASH_COMPLETION_FALSE
 ENABLE_BASH_COMPLETION_TRUE
 BASH_COMPLETION_DIR
-BASH_COMPLETION_LIBS
-BASH_COMPLETION_CFLAGS
 PKG_CONFIG_LIBDIR
 PKG_CONFIG_PATH
 PKG_CONFIG
@@ -696,9 +694,7 @@ LIBS
 CPPFLAGS
 PKG_CONFIG
 PKG_CONFIG_PATH
-PKG_CONFIG_LIBDIR
-BASH_COMPLETION_CFLAGS
-BASH_COMPLETION_LIBS'
+PKG_CONFIG_LIBDIR'
 
 
 # Initialize some variables set by options.
@@ -1249,7 +1245,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures tio 1.20 to adapt to many kinds of systems.
+\`configure' configures tio 1.24 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1316,7 +1312,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of tio 1.20:";;
+     short | recursive ) echo "Configuration of tio 1.24:";;
    esac
   cat <<\_ACEOF
 
@@ -1352,10 +1348,6 @@ Some influential environment variables:
               directories to add to pkg-config's search path
   PKG_CONFIG_LIBDIR
               path overriding pkg-config's built-in search path
-  BASH_COMPLETION_CFLAGS
-              C compiler flags for BASH_COMPLETION, overriding pkg-config
-  BASH_COMPLETION_LIBS
-              linker flags for BASH_COMPLETION, overriding pkg-config
 
 Use these variables to override the choices made by `configure' or to help
 it to find libraries and programs with nonstandard names/locations.
@@ -1424,7 +1416,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-tio configure 1.20
+tio configure 1.24
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1525,7 +1517,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by tio $as_me 1.20, which was
+It was created by tio $as_me 1.24, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2390,7 +2382,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='tio'
- VERSION='1.20'
+ VERSION='1.24'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -3901,77 +3893,7 @@ fi
 
 
 if test "x$with_bash_completion_dir" = "xyes"; then
-
-pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BASH_COMPLETION" >&5
-$as_echo_n "checking for BASH_COMPLETION... " >&6; }
-
-if test -n "$BASH_COMPLETION_CFLAGS"; then
-    pkg_cv_BASH_COMPLETION_CFLAGS="$BASH_COMPLETION_CFLAGS"
- elif test -n "$PKG_CONFIG"; then
-    if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"bash-completion >= 2.0\""; } >&5
-  ($PKG_CONFIG --exists --print-errors "bash-completion >= 2.0") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then
-  pkg_cv_BASH_COMPLETION_CFLAGS=`$PKG_CONFIG --cflags "bash-completion >= 2.0" 2>/dev/null`
-                     test "x$?" != "x0" && pkg_failed=yes
-else
-  pkg_failed=yes
-fi
- else
-    pkg_failed=untried
-fi
-if test -n "$BASH_COMPLETION_LIBS"; then
-    pkg_cv_BASH_COMPLETION_LIBS="$BASH_COMPLETION_LIBS"
- elif test -n "$PKG_CONFIG"; then
-    if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"bash-completion >= 2.0\""; } >&5
-  ($PKG_CONFIG --exists --print-errors "bash-completion >= 2.0") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then
-  pkg_cv_BASH_COMPLETION_LIBS=`$PKG_CONFIG --libs "bash-completion >= 2.0" 2>/dev/null`
-                     test "x$?" != "x0" && pkg_failed=yes
-else
-  pkg_failed=yes
-fi
- else
-    pkg_failed=untried
-fi
-
-
-
-if test $pkg_failed = yes; then
-       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
-        _pkg_short_errors_supported=yes
-else
-        _pkg_short_errors_supported=no
-fi
-        if test $_pkg_short_errors_supported = yes; then
-               BASH_COMPLETION_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "bash-completion >= 2.0" 2>&1`
-        else
-               BASH_COMPLETION_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "bash-completion >= 2.0" 2>&1`
-        fi
-       # Put the nasty error message in config.log where it belongs
-       echo "$BASH_COMPLETION_PKG_ERRORS" >&5
-
-       BASH_COMPLETION_DIR="${sysconfdir}/bash_completion.d"
-elif test $pkg_failed = untried; then
-       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-       BASH_COMPLETION_DIR="${sysconfdir}/bash_completion.d"
-else
-       BASH_COMPLETION_CFLAGS=$pkg_cv_BASH_COMPLETION_CFLAGS
-       BASH_COMPLETION_LIBS=$pkg_cv_BASH_COMPLETION_LIBS
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-       BASH_COMPLETION_DIR="`pkg-config --variable=completionsdir bash-completion`"
-fi
+    BASH_COMPLETION_DIR="${datadir}/bash-completion/completions"
 else
     BASH_COMPLETION_DIR="$with_bash_completion_dir"
 fi
@@ -5175,7 +5097,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by tio $as_me 1.20, which was
+This file was extended by tio $as_me 1.24, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -5242,7 +5164,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-tio config.status 1.20
+tio config.status 1.24
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
index 57b1d71c60597848f83600e5a84f8db1544f79f4..6c0b21b85b9c2f50f5b4a906518b472dd4d5391f 100644 (file)
@@ -1,5 +1,5 @@
 AC_PREREQ([2.68])
-AC_INIT([tio], [1.20], [], [tio], [https://tio.github.io])
+AC_INIT([tio], [1.24], [], [tio], [https://tio.github.io])
 AC_CONFIG_HEADERS([src/include/config.h])
 AM_INIT_AUTOMAKE([1.11 foreign dist-xz no-dist-gzip -Wall -Werror])
 AM_SILENT_RULES([yes])
@@ -17,9 +17,7 @@ AC_ARG_WITH([bash-completion-dir],
                    [with_bash_completion_dir=yes])
 
 if test "x$with_bash_completion_dir" = "xyes"; then
-    PKG_CHECK_MODULES([BASH_COMPLETION], [bash-completion >= 2.0],
-        [BASH_COMPLETION_DIR="`pkg-config --variable=completionsdir bash-completion`"],
-        [BASH_COMPLETION_DIR="${sysconfdir}/bash_completion.d"])
+    BASH_COMPLETION_DIR="${datadir}/bash-completion/completions"
 else
     BASH_COMPLETION_DIR="$with_bash_completion_dir"
 fi
index 62fbb06263c0cfc501e50a790971b7f9e9a826f3..2a4d92398ef0ea411b701775fdb04969fa503d38 100644 (file)
@@ -155,9 +155,7 @@ AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
-BASH_COMPLETION_CFLAGS = @BASH_COMPLETION_CFLAGS@
 BASH_COMPLETION_DIR = @BASH_COMPLETION_DIR@
-BASH_COMPLETION_LIBS = @BASH_COMPLETION_LIBS@
 BAUDRATES = @BAUDRATES@
 BAUDRATE_CASES = @BAUDRATE_CASES@
 CC = @CC@
index 628723bbb454620d06500d57450226894f44a445..13385339419523e005ac7341d8cc0acc8d01c65d 100644 (file)
--- a/man/tio.1
+++ b/man/tio.1
@@ -1,4 +1,4 @@
-.TH "tio" "1" "29 June 2016"
+.TH "tio" "1" "September 2017"
 
 .SH "NAME"
 tio \- a simple TTY terminal I/O application
@@ -45,11 +45,11 @@ Set output delay [ms] inserted between each transmitted character (default: 0).
 
 Disable automatic connect.
 
-By default tio automatically connects to the provided device if present. If the device is not present it will wait for it to appear and then connect. If the connection is lost (eg. device disconnects) it will wait for the device to reappear and then reconnect.
+By default tio automatically connects to the provided device if present. If the device is not present, it will wait for it to appear and then connect. If the connection is lost (eg. device disconnects), it will wait for the device to reappear and then reconnect.
 
 However, if the
 .B \-\-no\-autoconnect
-option is provided tio will exit if the device is not present or exit if an established connection is lost.
+option is provided, tio will exit if the device is not present or an established connection is lost.
 
 .TP
 .BR \-l ", " "\-\-log " \fI<filename>
@@ -70,8 +70,12 @@ Display help.
 In session, the following key sequences are intercepted as tio commands:
 .IP "\fBctrl-t ?"
 List available key commands
+.IP "\fBctrl-t b"
+Send serial break (triggers SysRq on Linux, etc.)
 .IP "\fBctrl-t c"
 Show configuration (baudrate, databits, etc.)
+.IP "\fBctrl-t h"
+Toggle hexadecimal mode
 .IP "\fBctrl-t l"
 Clear screen
 .IP "\fBctrl-t q"
index f09db52d81eb4a54bfca66e7f49190a7a1512fe5..b06b6d1a9c57e0c7709d0b1549ee32f1f48bbc7a 100644 (file)
@@ -14,8 +14,6 @@ tio_SOURCES = tty.c \
               include/tio/error.h
 
 if ENABLE_BASH_COMPLETION
-
 bashcompletiondir=@BASH_COMPLETION_DIR@
-dist_bashcompletion_DATA=bash-completion/tio
-
+bashcompletion_DATA=bash-completion/tio
 endif
index dc35dec2f847f34358c81183709d68ef0d33bd56..28410570cd849321a90e24166d4d415c03eff96e 100644 (file)
@@ -93,8 +93,7 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
-DIST_COMMON = $(srcdir)/Makefile.am \
-       $(am__dist_bashcompletion_DATA_DIST) $(am__DIST_COMMON)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/src/include/config.h
 CONFIG_CLEAN_FILES =
@@ -141,7 +140,6 @@ am__can_run_installinfo = \
     n|no|NO) false;; \
     *) (install-info --version) >/dev/null 2>&1;; \
   esac
-am__dist_bashcompletion_DATA_DIST = bash-completion/tio
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
 am__vpath_adj = case $$p in \
     $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
@@ -169,7 +167,7 @@ am__uninstall_files_from_dir = { \
     || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
          $(am__cd) "$$dir" && rm -f $$files; }; \
   }
-DATA = $(dist_bashcompletion_DATA)
+DATA = $(bashcompletion_DATA)
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
 # Read a list of newline-separated strings from the standard input,
 # and print each of them once, without duplicates.  Input order is
@@ -198,9 +196,7 @@ AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
-BASH_COMPLETION_CFLAGS = @BASH_COMPLETION_CFLAGS@
 BASH_COMPLETION_DIR = @BASH_COMPLETION_DIR@
-BASH_COMPLETION_LIBS = @BASH_COMPLETION_LIBS@
 BAUDRATES = @BAUDRATES@
 BAUDRATE_CASES = @BAUDRATE_CASES@
 CC = @CC@
@@ -299,7 +295,7 @@ tio_SOURCES = tty.c \
               include/tio/error.h
 
 @ENABLE_BASH_COMPLETION_TRUE@bashcompletiondir = @BASH_COMPLETION_DIR@
-@ENABLE_BASH_COMPLETION_TRUE@dist_bashcompletion_DATA = bash-completion/tio
+@ENABLE_BASH_COMPLETION_TRUE@bashcompletion_DATA = bash-completion/tio
 all: all-am
 
 .SUFFIXES:
@@ -406,9 +402,9 @@ distclean-compile:
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-install-dist_bashcompletionDATA: $(dist_bashcompletion_DATA)
+install-bashcompletionDATA: $(bashcompletion_DATA)
        @$(NORMAL_INSTALL)
-       @list='$(dist_bashcompletion_DATA)'; test -n "$(bashcompletiondir)" || list=; \
+       @list='$(bashcompletion_DATA)'; test -n "$(bashcompletiondir)" || list=; \
        if test -n "$$list"; then \
          echo " $(MKDIR_P) '$(DESTDIR)$(bashcompletiondir)'"; \
          $(MKDIR_P) "$(DESTDIR)$(bashcompletiondir)" || exit 1; \
@@ -422,9 +418,9 @@ install-dist_bashcompletionDATA: $(dist_bashcompletion_DATA)
          $(INSTALL_DATA) $$files "$(DESTDIR)$(bashcompletiondir)" || exit $$?; \
        done
 
-uninstall-dist_bashcompletionDATA:
+uninstall-bashcompletionDATA:
        @$(NORMAL_UNINSTALL)
-       @list='$(dist_bashcompletion_DATA)'; test -n "$(bashcompletiondir)" || list=; \
+       @list='$(bashcompletion_DATA)'; test -n "$(bashcompletiondir)" || list=; \
        files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
        dir='$(DESTDIR)$(bashcompletiondir)'; $(am__uninstall_files_from_dir)
 
@@ -569,7 +565,7 @@ info: info-am
 
 info-am:
 
-install-data-am: install-dist_bashcompletionDATA
+install-data-am: install-bashcompletionDATA
 
 install-dvi: install-dvi-am
 
@@ -614,7 +610,7 @@ ps: ps-am
 
 ps-am:
 
-uninstall-am: uninstall-binPROGRAMS uninstall-dist_bashcompletionDATA
+uninstall-am: uninstall-bashcompletionDATA uninstall-binPROGRAMS
 
 .MAKE: install-am install-strip
 
@@ -622,16 +618,16 @@ uninstall-am: uninstall-binPROGRAMS uninstall-dist_bashcompletionDATA
        clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \
        distclean distclean-compile distclean-generic distclean-tags \
        distdir dvi dvi-am html html-am info info-am install \
-       install-am install-binPROGRAMS install-data install-data-am \
-       install-dist_bashcompletionDATA install-dvi install-dvi-am \
+       install-am install-bashcompletionDATA install-binPROGRAMS \
+       install-data install-data-am install-dvi install-dvi-am \
        install-exec install-exec-am install-html install-html-am \
        install-info install-info-am install-man install-pdf \
        install-pdf-am install-ps install-ps-am install-strip \
        installcheck installcheck-am installdirs maintainer-clean \
        maintainer-clean-generic mostlyclean mostlyclean-compile \
        mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \
-       uninstall-am uninstall-binPROGRAMS \
-       uninstall-dist_bashcompletionDATA
+       uninstall-am uninstall-bashcompletionDATA \
+       uninstall-binPROGRAMS
 
 .PRECIOUS: Makefile
 
diff --git a/src/bash-completion/tio b/src/bash-completion/tio
deleted file mode 100644 (file)
index 84e21b0..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-#
-# Bash completion script for tio.
-#
-
-_tio()
-{
-    local cur prev opts base
-    COMPREPLY=()
-    cur="${COMP_WORDS[COMP_CWORD]}"
-    prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    #  The options we'll complete.
-    opts="-b --baudrate \
-          -d --databits \
-          -f --flow \
-          -s --stopbits \
-          -p --parity \
-          -o --output-delay \
-          -n --no-autoconnect \
-          -l --log \
-          -v --version \
-          -h --help"
-
-    #  Complete the arguments to the options.
-    case "${prev}" in
-        -b | --baudrate)
-            local baudrates=" 0 50 75 110 134 150 200 300 600 1200 1800 2400 4800 9600 19200 38400 57600 115200 230400 460800 500000 576000 921600 1000000 1152000 1500000 2000000 2500000 3000000 3500000 4000000"
-            COMPREPLY=( $(compgen -W "$baudrates" -- ${cur}) )
-            return 0
-            ;;
-        -d | --databits)
-            COMPREPLY=( $(compgen -W "5 6 7 8" -- ${cur}) )
-            return 0
-            ;;
-        -f | --flow)
-            COMPREPLY=( $(compgen -W "hard soft none" -- ${cur}) )
-            return 0
-            ;;
-        -s | --stopbits)
-            COMPREPLY=( $(compgen -W "1 2" -- ${cur}) )
-            return 0
-            ;;
-        -p | --parity)
-            COMPREPLY=( $(compgen -W "even odd none" -- ${cur}) )
-            return 0
-            ;;
-        -o | --output-delay)
-            COMPREPLY=( $(compgen -W "0 1 10 100" -- ${cur}) )
-            return 0
-            ;;
-        -n | --no-autoconnect)
-            COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
-            return 0
-            ;;
-        -l | --log)
-            COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
-            return 0
-            ;;
-        -v | --version)
-            COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
-            return 0
-            ;;
-        -h | --help)
-            COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
-            return 0
-            ;;
-        *)
-        ;;
-    esac
-
-   COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
-   return 0
-}
-
-# Bind completion to tio command
-complete -o default -F _tio tio
index 9f1fbd71768ea74d0f559f72540e46ea73d1cb98..b7624d848448b113d963bfca5997daf4e302d0c8 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * tio - a simple TTY terminal I/O application
  *
- * Copyright (c) 2014-2016  Martin Lund
+ * Copyright (c) 2014-2017  Martin Lund
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
index d41dcaa63d4276982de0aaf66d49b1f1387bb361..81c29c917566d3408cefffaa53b2ace88e72e86b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * tio - a simple TTY terminal I/O application
  *
- * Copyright (c) 2014-2016  Martin Lund
+ * Copyright (c) 2014-2017  Martin Lund
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
index a8e965674bc8a4413bf7f89660824e6f9e9e590a..41b510322b026b3f61c5491739eb834e10e0d3ce 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * tio - a simple TTY terminal I/O application
  *
- * Copyright (c) 2014-2016  Martin Lund
+ * Copyright (c) 2014-2017  Martin Lund
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
index b89ad1a3ba0dfc38b90d6dbee2e1eed4499d8baa..15f3cf79ee5c46404cb3e353fe824c9841932f69 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * tio - a simple TTY terminal I/O application
  *
- * Copyright (c) 2014-2016  Martin Lund
+ * Copyright (c) 2014-2017  Martin Lund
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
index 72541741918194affcd1aa27dc8ef26987ee2362..56894c257df6245ac8e7f376c231723a7f10d503 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * tio - a simple TTY terminal I/O application
  *
- * Copyright (c) 2014-2016  Martin Lund
+ * Copyright (c) 2014-2017  Martin Lund
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
index fe155589b52adb8b4ffa520b25a357135f8af150..b395f5abba919ef0dd2ea44394c8182d33cc9445 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * tio - a simple TTY terminal I/O application
  *
- * Copyright (c) 2014-2016  Martin Lund
+ * Copyright (c) 2014-2017  Martin Lund
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
index c2fd8138c109c5de82d75f979ca1c8b81de5203b..9b48751444bfc478b25eb1e4c748af964220486d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * tio - a simple TTY terminal I/O application
  *
- * Copyright (c) 2014-2016  Martin Lund
+ * Copyright (c) 2014-2017  Martin Lund
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
 #define TTY_H
 
 #define KEY_QUESTION 0x3f
+#define KEY_B 0x62
 #define KEY_C 0x63
+#define KEY_H 0x68
 #define KEY_L 0x6C
 #define KEY_Q 0x71
 #define KEY_S 0x73
 #define KEY_T 0x74
 #define KEY_CTRL_T 0x14
 
+#define NORMAL 0
+#define HEX 1
+
 void stdout_configure(void);
 void stdout_restore(void);
 void tty_configure(void);
index 78503815a13158f6adc782606f3f76221dc28fb7..f246bc2750139bc3378c0eaed58fcae6015eeb8b 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -1,7 +1,7 @@
 /*
  * tio - a simple TTY terminal I/O application
  *
- * Copyright (c) 2014-2016  Martin Lund
+ * Copyright (c) 2014-2017  Martin Lund
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
index 02019cc310a19a9a88ab2ef4216626e24655b5ce..683c62740cf12985d348f741bd6e6dfcee7448ac 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * tio - a simple TTY terminal I/O application
  *
- * Copyright (c) 2014-2016  Martin Lund
+ * Copyright (c) 2014-2017  Martin Lund
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
index e280fffd56e3defd339f2758e51e327f4b14dbc2..67275c39b2da61f2d566651d0e77cdced6ca6c44 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * tio - a simple TTY terminal I/O application
  *
- * Copyright (c) 2014-2016  Martin Lund
+ * Copyright (c) 2014-2017  Martin Lund
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -167,7 +167,7 @@ void parse_options(int argc, char *argv[])
 
             case 'v':
                 printf("tio v%s\n", VERSION);
-                printf("Copyright (c) 2014-2016 Martin Lund\n");
+                printf("Copyright (c) 2014-2017 Martin Lund\n");
                 printf("\n");
                 printf("License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl-2.0.html>.\n");
                 printf("This is free software: you are free to change and redistribute it.\n");
index 0acc9f8cbdf509210be1ea2757d3128913c9c4ac..68f160c878397417f044a008472e555c17115412 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * tio - a simple TTY terminal I/O application
  *
- * Copyright (c) 2014-2016  Martin Lund
+ * Copyright (c) 2014-2017  Martin Lund
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
index c4d52b4912abcd38f237647076856fbd7f8ef36b..07342474bb5049af939844e7d7a8454729672fba 100644 (file)
--- a/src/tty.c
+++ b/src/tty.c
@@ -1,7 +1,7 @@
 /*
  * tio - a simple TTY terminal I/O application
  *
- * Copyright (c) 2014-2016  Martin Lund
+ * Copyright (c) 2014-2017  Martin Lund
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -47,6 +47,8 @@ static unsigned long rx_total = 0, tx_total = 0;
 static bool connected = false;
 static bool tainted = false;
 static int fd;
+static bool print_mode = NORMAL;
+static void (*print)(char c);
 
 #define tio_printf(format, args...) \
 { \
@@ -55,6 +57,16 @@ static int fd;
     tainted = false; \
 }
 
+static void print_hex(char c)
+{
+    printf("%02x ", (unsigned char) c);
+}
+
+static void print_normal(char c)
+{
+    putchar(c);
+}
+
 void handle_command_sequence(char input_char, char previous_char, char *output_char, bool *forward)
 {
     char unused_char;
@@ -71,18 +83,27 @@ void handle_command_sequence(char input_char, char previous_char, char *output_c
     /* Handle escape key commands */
     if (previous_char == KEY_CTRL_T)
     {
+        /* Do not forward input char to output by default */
+        *forward = false;
+
         switch (input_char)
         {
             case KEY_QUESTION:
                 tio_printf("Key commands:");
                 tio_printf(" ctrl-t ?   List available key commands");
+                tio_printf(" ctrl-t b   Send break");
                 tio_printf(" ctrl-t c   Show configuration");
+                tio_printf(" ctrl-t h   Toggle hexadecimal mode");
                 tio_printf(" ctrl-t l   Clear screen");
                 tio_printf(" ctrl-t q   Quit");
                 tio_printf(" ctrl-t s   Show statistics");
                 tio_printf(" ctrl-t t   Send ctrl-t key code");
-                *forward = false;
                 break;
+
+            case KEY_B:
+                tcsendbreak(fd, 0);
+                break;
+
             case KEY_C:
                 tio_printf("Configuration:");
                 tio_printf(" TTY device: %s", option.tty_device);
@@ -94,28 +115,48 @@ void handle_command_sequence(char input_char, char previous_char, char *output_c
                 tio_printf(" Output delay: %d", option.output_delay);
                 if (option.log)
                     tio_printf(" Log file: %s", option.log_filename);
-                *forward = false;
                 break;
+
+            case KEY_H:
+                /* Toggle hexadecimal printing mode */
+                if (print_mode == NORMAL)
+                {
+                    print = print_hex;
+                    print_mode = HEX;
+                    tio_printf("Switched to hexadecimal mode");
+                }
+                else
+                {
+                    print = print_normal;
+                    print_mode = NORMAL;
+                    tio_printf("Switched to normal mode");
+                }
+                break;
+
             case KEY_L:
-                status = system("clear");
-                 *forward = false;
+                /* Clear screen using ANSI/VT100 escape code */
+                printf("\033c");
+                fflush(stdout);
                 break;
+
             case KEY_Q:
                 /* Exit upon ctrl-t q sequence */
                 exit(EXIT_SUCCESS);
+
             case KEY_S:
                 /* Show tx/rx statistics upon ctrl-t s sequence */
                 tio_printf("Statistics:");
                 tio_printf(" Sent %lu bytes, received %lu bytes", tx_total, rx_total);
-                *forward = false;
                 break;
+
             case KEY_T:
                 /* Send ctrl-t key code upon ctrl-t t sequence */
                 *output_char = KEY_CTRL_T;
+                *forward = true;
                 break;
+
             default:
                 /* Ignore unknown ctrl-t escaped keys */
-                *forward = false;
                 break;
         }
     }
@@ -157,6 +198,9 @@ void stdout_configure(void)
     tio_printf("tio v%s", VERSION);
     tio_printf("Press ctrl-t q to quit");
 
+    /* At start use normal print function */
+    print = print_normal;
+
     /* Make sure we restore old stdout settings on exit */
     atexit(&stdout_restore);
 }
@@ -454,7 +498,7 @@ int tty_connect(void)
                     rx_total++;
 
                     /* Print received tty character to stdout */
-                    putchar(input_char);
+                    print(input_char);
                     fflush(stdout);
 
                     /* Write to log */