Commit graph

1083 commits

Author SHA1 Message Date
Martin Lund
31647a934c List available profiles in --list output 2024-05-03 11:35:48 +02:00
Martin Lund
e9c96c5456 Update NEWS 2024-05-03 10:47:01 +02:00
Martin Lund
3b3fca2e8b Always message when saving log file 2024-05-03 10:45:49 +02:00
Martin Lund
a53a4f44de Update NEWS 2024-05-03 10:36:14 +02:00
Martin Lund
60caede5dd Add support for using TID as device in config file 2024-05-03 10:32:33 +02:00
Martin Lund
eae7f8f8d7 Update NEWS 2024-05-03 10:02:44 +02:00
Martin Lund
04dfa682c9 Fix use of invalid flag with regexec() 2024-05-03 09:19:21 +02:00
Martin Lund
62a4a93dec Fix potential buffer overflow in match_and_replace() 2024-05-03 08:39:58 +02:00
Martin Lund
7aa2d3fee2 Fix profile autocompletion 2024-05-03 02:12:12 +02:00
Martin Lund
22bcfdc29f Remove inih dependency from CI builds 2024-05-02 23:44:26 +02:00
Martin Lund
0e9dbcbc77 Replace use of stat() with fstat()
For better security.
2024-05-02 22:30:47 +02:00
Martin Lund
68c78222e1 Fix hexN output mode 2024-05-02 21:50:48 +02:00
Martin Lund
22b4f451ea Update pattern matching example 2024-05-02 20:42:10 +02:00
Martin Lund
15ba034ce5 Fix submenu response when invalid key hit 2024-05-02 19:38:14 +02:00
Martin Lund
17bb6edfd2 Bump version 2024-05-02 18:52:52 +02:00
Martin Lund
65c5a068d8 Replace inih with glib key file parser
After including the use of glib we might as well replace inih
with the glib key file parser.

All configuraiton file parsing has been reworked and also the options
parsing has been cleaned up, resulting in better and stricter
configuration file and option value checks.

Compared to old, configuration files now requires any default
configurations to be put in a group/section named [default].

Configuration file keywords such as "enable", "disable", "on",
"off", "yes", "no", "0", "1" have been retired. Now only "true" and
"false" apply to boolean configuration options. This is done to simplify
things and avoid any confusion.

The pattern option feature has been reworked so now the user can now
access the full match string and any matching subexpression using the
%mN syntax.

For example:

[usb devices]
pattern = usb([0-9]*)
device = /dev/ttyUSB%m1

Then when using tio:
$ tio usb12

   %m0 = 'usb12'  // Full match string
   %m1 = 12       // First match subexpression

Which results in device = /dev/ttyUSB12
2024-05-02 18:35:37 +02:00
Martin Lund
68d3b845b2 Remove CircleCI
Replaced with github workflow CI.
2024-04-30 13:40:07 +02:00
Martin Lund
22f030ebb8 Add github workflow for Ubuntu build 2024-04-30 13:35:46 +02:00
Rui Chen
f5703ff107 remove verbose for meson install and use system glib and pkg-config
Signed-off-by: Rui Chen <rui@chenrui.dev>
2024-04-30 10:02:19 +02:00
Rui Chen
3b77eb35cf fix: add build patch for FNM_EXTMATCH
run into the following build failure

```
cc -Isrc/tio.p -Isrc -I../src -I/opt/homebrew/Cellar/glib/2.80.0_2/include/glib-2.0 -I/opt/homebrew/Cellar/glib/2.80.0_2/lib/glib-2.0/include -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/Cellar/pcre2/10.43/include -I/opt/homebrew/Cellar/inih/58/include -I/opt/homebrew/include/lua -fdiagnostics-color=always -Wall -Winvalid-pch -Wextra -std=gnu99 -O3 -Wno-unused-result -DHAVE_IOSSIOSPEED -MD -MQ src/tio.p/misc.c.o -MF src/tio.p/misc.c.o.d -o src/tio.p/misc.c.o -c ../src/misc.c
../src/misc.c:201:38: error: use of undeclared identifier 'FNM_EXTMATCH'
        if (fnmatch(pattern, string, FNM_EXTMATCH) == 0)
                                     ^
1 error generated.
```

Signed-off-by: Rui Chen <rui@chenrui.dev>
2024-04-30 10:02:19 +02:00
Rui Chen
054326454b feat: add macos workflow
Signed-off-by: Rui Chen <rui@chenrui.dev>
2024-04-30 10:02:19 +02:00
Rui Chen
b763f1289b fix: add macos build patch for fs_get_creation_time
Signed-off-by: Rui Chen <rui@chenrui.dev>
2024-04-29 20:21:51 +02:00
Martin Lund
8ead9337d1 Enable extended pattern matching
So that the exclude options can also work as include using special
pattern syntax.

For example, to only include /dev/ttyUSB* devices simply do:

$ tio --exclude-devices=!(/dev/ttyUSB*) --list

See the man page of fnmatch() for all available extended pattern
options.
2024-04-29 19:36:44 +02:00
Martin Lund
d8fb141bc4 Update lua read() description 2024-04-29 16:47:00 +02:00
Martin Lund
a698799a7d Update man page 2024-04-29 16:22:01 +02:00
Martin Lund
5e3722a10e Update man page 2024-04-29 16:09:37 +02:00
Martin Lund
c16a2a1f94 Update README 2024-04-29 16:05:14 +02:00
Martin Lund
e2960c3f82 Update README 2024-04-29 16:00:12 +02:00
Martin Lund
08404e700f Update NEWS 2024-04-29 15:48:00 +02:00
Martin Lund
6d77201ba0 Simplify lua line manipulation API
Collapses lua high(), low(), toggle(), config_high(), config_low(),
config_apply() into one simple function:

set{<line>=<state>, ...}

Line can be any of DTR, RTS, CTS, DSR, CD, RI.

State is high, low, or toggle.

Example:
script = set{DTR=high, RTS=low}; msleep(100); set{DTR=low, RTS=high}; msleep(100); set{RTS=low}

Notice the use of {} instad of () when calling the set function. This is
required to pass parameters by name in lua.
2024-04-29 15:20:53 +02:00
Martin Lund
eef0a15194 Unshadow variable 2024-04-29 01:49:44 +02:00
Martin Lund
6895c05321 Update README 2024-04-28 18:23:08 +02:00
Martin Lund
c453728ab5 Update README 2024-04-28 17:26:10 +02:00
Martin Lund
273afb73f4 Update README 2024-04-28 17:22:26 +02:00
Martin Lund
84dd4c3685 Update README 2024-04-28 14:47:07 +02:00
Martin Lund
33eae0c30d Update script API 2024-04-28 14:46:41 +02:00
Martin Lund
9bc93991e7 Update NEWS 2024-04-27 23:51:01 +02:00
Martin Lund
ed70a587ec Update NEWS 2024-04-27 19:30:24 +02:00
Martin Lund
fe2973522e Fix shadow variable 2024-04-27 19:11:37 +02:00
Martin Lund
f5f62ee02d Disable DEC Special Graphics at exit if vt100
If a vt100 terminal receives the Shift In character '\016' it will
enable the 7 bit DEC Special Graphics character set used for line drawing.

For most users this can happen due to line noise from the tty device and
will likely mess up your terminal even after tio exits.

To better handle this we want to make sure that tio disables this mode
by sending the Shift Out character '\017' at exit.

This mechanism will only activate if environment variable TERM assumes
value "vt100".
2024-04-27 17:32:48 +02:00
Martin Lund
cd160250a6 Cleanup 2024-04-27 17:13:06 +02:00
Martin Lund
588ac3e8ac Update TODO 2024-04-27 15:45:34 +02:00
Martin Lund
76de9b890e Update README 2024-04-27 15:33:22 +02:00
Martin Lund
42ff234204 Add hexN output mode
Adds support for hexN mode where N is a number in the range 1 to 4096
which defines how many hex values will be printed before a line break.

In short, it defines the width of the hex output.

In this mode, if timestamps are enabled they will be added to each hex
line.
2024-04-27 15:25:34 +02:00
Martin Lund
4113a072c2 Make sure to reset tainted state 2024-04-27 14:41:08 +02:00
Martin Lund
232cbee697 Rename sub-config to profile
Because better naming.
2024-04-27 09:13:33 +02:00
Martin Lund
1b77ed783b Update README 2024-04-27 02:30:22 +02:00
Martin Lund
41b8e4f99c Update README 2024-04-27 02:03:12 +02:00
Martin Lund
c61d56935b Fix excludes pattern matching 2024-04-27 01:31:43 +02:00
Martin Lund
6e779a0520 Use lua io.write() instead of print()
io.write() gives better output control as print() is hardcoded to always
print a newline.
2024-04-27 00:48:38 +02:00