Commit graph

1260 commits

Author SHA1 Message Date
Pier-Luc Thériault
d1271c8612 Send remainder of tty_buffer before exiting for piped input 2026-02-16 11:29:53 -05:00
Pier-Luc Thériault
8e6d77407e Use tty_write to write piped input to tty 2026-02-16 11:29:53 -05:00
Jakob Haufe
6fb3a64ba2 Fix license in meson.build
- Make license here match LICENSE
- According to meson docs, it should not be an array
2026-01-22 12:41:01 +01:00
aiotter
3af4c5591e Fix redundant output on macOS 2025-08-07 17:18:29 +02:00
John Barbero Unenge
cce94b9d92 Add --complete-profiles to help printout and man pages 2025-06-17 16:30:31 +02:00
ii8
86f48a2fb6 Overhaul Lua API
Lua API moved into a tio library table and names adjusted to Lua stdlib style.
Regex in expect() replaced with Lua patterns so binary data can be handled.
New tio.alwaysecho variable allows enabling and disabling echo to console.
Read and write functions now manage complex retry and timeout logic internally,
giving the user a simple "nil if fail" API like the rest of Lua.
exit() was removed, os.exit() already exists in the Lua standard library.
2025-06-14 15:09:21 +02:00
Martin Lund
381c0b7823 Update codeql to v3 2025-06-14 07:03:17 +02:00
Martin Lund
8f33cff6ea Disable compiler warning on unused result 2025-05-31 19:43:11 +02:00
Keith Barratt
9d00cd3492 Fix device description-Linux
This commit only effects Linux.

The description field of the `device_list`, populated by
`tty_search_for_serial_devices()`, was either incorrect or less than ideal
for CDC ACM virtual com ports. For instance:
    (i) Some devices incorrectly have the description field populated by
    the 'product' property of USB hub they are connected via.
    (ii) Other devices have description fields populated with the interface,
    e.g. CDC, when there is a 'product' property available that would give a
    clearer description.

To solve these issues, we first prioritise searching for the 'product' property
of the device over the 'interface' property. We also look for the
'product' property in an additional directory.
2025-05-30 17:20:06 +02:00
Martin Lund
3e0b2d861d Fix Ubuntu workflow 2025-05-30 17:18:21 +02:00
ii8
a1217af4c6 Fix string truncation bug in scripting api 2025-05-25 21:13:43 +02:00
Martin Lund
58bf5c5008 Update tio man page 2025-05-25 19:46:18 +02:00
Maximilian Seesslen
7e61a34df3 Added timestamp format "epoch-usec"
This timestamp format will print the seconds since epoch along with
subdivision in microseconds.

Example:
 [1748009585.087083] tio v3.9-8-g2fb788f-dirty
 [1748009585.087156] Press ctrl-t q to quit
 [1748009585.087683] Connected to /dev/ttyUSB0
2025-05-23 16:36:39 +02:00
Hideaki Tai
2fb788f817 fix: lua script stops output if it includes null terminate 2025-05-06 17:28:53 +02:00
Martin Lund
f887756a71 meson: Enable compiler warnings on unused result and global shadows 2025-04-29 17:44:08 +02:00
Robert Lipe
5d915134a3 Fix --auto new and --auto latest on MacOS. (redo)
Git is being dumb about
67c071633d This PR is identical to that one and will supercede it.

Fix --auto new and --auto latest on MacOS.

'device_list' was both a global (eww!) and a local inside
tty_search_for_serial_devices(). The local got set and
returned, so it looked sane, but the caller used the global
instead of the return value of the function it had just
called, meaning (global) device_list was NULL while
(ignored, local) device_list held a perfectly lovely
linked list.

Tested:
tio --auto new waits for a new device to appare and connects
tio --latest will connect to the most recently attached device
  which, in most worlds, is the most recently enumerated USB
  device, conveniently skipping all the bluetooth nonsense.
  If the lone USB device is disconnected, it then connects to
  one of those, meaning you really do have to restart tio.
2025-04-29 17:05:24 +02:00
Robert Lipe
7516dff802 Add missing build piece. 2025-04-24 17:55:26 +02:00
Robert Lipe
03ef931fb2 - Implemented getPropertyString(), getDeviceLocation(), tty_search_for_serial_devices()
for MacOS
- Added error handling and memory management
- Improved code readability and consistency
- Updated coding style to match project conventions

- Added robust error checking for CoreFoundation property retrieval
- Implemented more defensive memory allocation and type checking
- Switched to using callout device key for more reliable device discovery
- Added single-line block bracing consistent with project style
- Improved comments and code formatting

- Used `kIOCalloutDeviceKey` instead of `kIODialinDeviceKey` for device path retrieval
- Enhanced type checking for CoreFoundation objects
- Simplified memory management and error handling
- Added additional logging and error reporting

- Verified functionality on MacOS 10.11 and 10.15. Tested with ESP32-P4 and ESP32-BOX

Resolves potential device discovery and memory management issues in the MacOS serial device detection code.
2025-04-24 17:55:26 +02:00
Martin Lund
437881f0ed Update AUTHORS 2025-04-23 08:17:11 +02:00
David Ordnung
c736b1e353 Input ICRCRNL mapping to avoid using INLCRNL with ICRNL 2025-04-23 08:09:22 +02:00
Martin Lund
d682e98a66 codeql: Build using ubuntu-22.04 2025-04-16 10:47:39 +02:00
Martin Lund
bdfe87e1cb Update date 2025-04-13 13:31:06 +02:00
Martin Lund
5c2ced1093 Update NEWS 2025-04-13 13:27:50 +02:00
Martin Lund
f87f470415 Fix pattern matching memory corruption 2025-04-13 13:25:25 +02:00
Martin Lund
2e86718973 Add typos.toml 2025-04-13 08:28:01 +02:00
Martin Lund
013aebcc05 Update NEWS 2025-04-12 09:02:22 +02:00
Martin Lund
b33045189f Update plain text man page 2025-04-12 08:57:25 +02:00
Martin Lund
600c3d7563 Update version date 2025-04-12 08:55:40 +02:00
Martin Lund
ebce2d4ee9 Bump version 2025-04-12 08:55:11 +02:00
Martin Lund
16b7aee42f Update NEWS 2025-04-12 08:54:50 +02:00
Martin Lund
d33e275ca3 Update AUTHORS 2025-03-23 07:04:47 +01:00
Samuel Holland
da4074c9a5 Don't add null characters to the expect buffer
They prevent regexec() from seeing the remainder of the buffer.
2025-03-23 07:02:56 +01:00
Martin Lund
f716d2ccdd Update TODO 2025-03-13 15:44:12 +01:00
V
7567e08227 Disable stdout buffering globally
This makes it possible to pipe output to other programs cleanly.
2025-03-11 20:46:14 +01:00
Martin Lund
6aca9ffee5 Update AUTHORS 2025-03-10 16:17:56 +01:00
Lubov66
f5740dbf31 docs: edited the license date 2025-03-10 16:12:53 +01:00
Lubov66
d163afc6b1 Update README.md 2025-03-10 11:37:32 +01:00
Lubov66
1b60dd1ae7 Update README.md 2025-03-10 11:07:03 +01:00
Martin Lund
795ef28f79 Update TODO 2025-02-25 16:16:24 +01:00
Martin Lund
8e155c9276 Update TODO 2025-02-23 16:26:28 +01:00
Martin Lund
6831ad0eae Fix parsing of timestamp options 2025-02-15 20:27:53 +01:00
Martin Lund
8f7bf2fd2c codeql: Upgrade to upload-artifact@v4 2025-02-08 02:58:02 +01:00
Martin Lund
f389f11669 Update plaintext man page 2025-01-26 16:41:24 +01:00
Martin Lund
37994b3cc5 Add character mapping examples 2025-01-25 15:09:07 +01:00
Jakob Haufe
27f8f2c4e6 Manpage: Fix backslash encoding
Literal backslash needs to be written as \e.
2024-12-01 14:32:56 +01:00
Martin Lund
01e637cdf4 Update NEWS 2024-11-30 12:40:48 +01:00
Martin Lund
1b2a0ea130 Update version date 2024-11-30 12:12:09 +01:00
Martin Lund
b8135ea639 Rename git version to simply version 2024-11-30 11:37:27 +01:00
Martin Lund
c49faa7337 Clean up lua API
Rename modem_send() to send()
Rename send to write()
2024-11-30 11:09:43 +01:00
Martin Lund
4511d74a9e Update AUTHORS 2024-11-07 22:17:26 +01:00