Add $TerminalHyperlinks system variable.

This lets you turn any reminder with an INFO "Url: ..." string
into a hyperlink on the terminal.
This commit is contained in:
Dianne Skoll
2026-01-08 14:13:34 -05:00
parent 3e6233b6f0
commit f6253d0fca
14 changed files with 141 additions and 52 deletions

View File

@@ -402,6 +402,7 @@ Tcl
Td
Terbeck
TerminalBackground
TerminalHyperlinks
Thronicke
TimeSep
TimetIs64bit

View File

@@ -961,6 +961,14 @@ SET $ParseUntriggered 1
REM 1 Jan 1994 MSG 1/0 = [1/0]
EOF
# Calendars with hyperlinks
$REMIND -w,0,0 -@2 -c - 1 Jan 2020 <<'EOF' >> $OUT 2>&1
SET $TerminalHyperlinks 1
REM 15 INFO "Url: https://dianne.skoll.ca" MSG Hello, linky!
REM 16 INFO "Url: https://dianne.skoll.ca" MSF Hello, linky!
REM 17 INFO "Url: https://dianne.skoll.ca" CAL Hello, linky!
REM 18 INFO "Url: https://dianne.skoll.ca" SPECIAL COLOR 255 0 0 Hello, linky!
EOF
cmp -s $OUT $CMP
if [ "$?" = "0" ]; then
echo "Remind: Acceptance tests ${GRN}PASSED${NRM}"

View File

@@ -16759,7 +16759,10 @@ mbpad("
bad => "ÿ"
mbpad("ÿ", "bar", 8, 1) => Invalid multibyte sequence
../tests/test.rem(1891): mbpad(): Invalid multibyte sequence
DynBuf Mallocs: 1114 mallocs; 31872128 bytes
]8;;https://dianne.skoll.ca\Hello, linky!
]8;;\]8;;https://dianne.skoll.ca\Hello, linky!
]8;;\]8;;https://dianne.skoll.ca\Hello, linky!
]8;;\DynBuf Mallocs: 1120 mallocs; 31872640 bytes
Variable hash table statistics:
Entries: 100146; Buckets: 87719; Non-empty Buckets: 66303
Maxlen: 5; Minlen: 0; Avglen: 1.142; Stddev: 0.878; Avg nonempty len: 1.510
@@ -16781,7 +16784,7 @@ Expression nodes high-water: 302076
Expression nodes leaked: 0
Parse level high-water: 34
Max expr node evaluations per line: 2001
Total expression node evaluations: 106732
Total expression node evaluations: 106733
Test 2
@@ -24950,6 +24953,7 @@ $T
$Tb
$Td
$TerminalBackground
$TerminalHyperlinks
$Thursday
$TimeSep
$TimetIs64bit
@@ -40154,3 +40158,21 @@ February 28
-stdin-(2): `/': Division by zero
-stdin-(2): `/': Division by zero
# rem2ps end
+----------------------------------------------------------------------------+
| January 2020 |
+----------+----------+----------+----------+----------+----------+----------+
| Sunday | Monday | Tuesday |Wednesday | Thursday | Friday | Saturday |
+----------+----------+----------+----------+----------+----------+----------+
| | | |1 |2 |3 |4 |
+----------+----------+----------+----------+----------+----------+----------+
|5 |6 |7 |8 |9 |10 |11 |
+----------+----------+----------+----------+----------+----------+----------+
|12 |13 |14 |15 |16 |17 |18 |
| | | |]8;;https://dianne.skoll.ca\Hello,]8;;\ |]8;;https://dianne.skoll.ca\Hello,]8;;\ |]8;;https://dianne.skoll.ca\Hello,]8;;\ |]8;;https://dianne.skoll.ca\Hello,]8;;\ |
| | | |]8;;https://dianne.skoll.ca\linky!]8;;\ |]8;;https://dianne.skoll.ca\linky!]8;;\ |]8;;https://dianne.skoll.ca\linky!]8;;\ |]8;;https://dianne.skoll.ca\linky!]8;;\ |
+----------+----------+----------+----------+----------+----------+----------+
|19 |20 |21 |22 |23 |24 |25 |
+----------+----------+----------+----------+----------+----------+----------+
|26 |27 |28 |29 |30 |31 | |
+----------+----------+----------+----------+----------+----------+----------+

View File

@@ -1891,6 +1891,11 @@ set a mbpad(bad, "bar", 8)
set a mbpad(bad, "bar", 8, 1)
DEBUG -x
SET $TerminalHyperlinks 1
REM INFO "Url: https://dianne.skoll.ca" MSG Hello, linky!
REM INFO "Url: https://dianne.skoll.ca" MSF Hello, linky!
REM INFO "Url: https://dianne.skoll.ca" SPECIAL COLOR 255 0 0 Hello, linky!
# Don't want Remind to queue reminders
EXIT