Only set default for TerminalHyperlinks if it hasn't explicitly been set

(for example, with '-i$TerminalHyperlinks=n')
This commit is contained in:
Dianne Skoll
2026-01-11 10:58:30 -05:00
parent c43eaec274
commit 85a8a4b016
2 changed files with 7 additions and 3 deletions

View File

@@ -174,7 +174,7 @@ EXTERN INIT( char *Location, LOCATION);
/* Support hyperlinks in terminal emulators?
https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda
*/
EXTERN INIT( int TerminalHyperlinks, 0);
EXTERN INIT( int TerminalHyperlinks, -1);
/* UTC calculation stuff */
EXTERN INIT( int MinsFromUTC, 0);
EXTERN INIT( int CalculateUTC, 1);

View File

@@ -851,8 +851,12 @@ void InitRemind(int argc, char const *argv[])
}
/* If stdout is a tty, enable terminal hyperlinks by default */
if (isatty(STDOUT_FILENO)) {
TerminalHyperlinks = 1;
if (TerminalHyperlinks == -1) {
if (isatty(STDOUT_FILENO)) {
TerminalHyperlinks = 1;
} else {
TerminalHyperlinks = 0;
}
}
}