]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
libtextstyle: Turn off hyperlinks on the Solaris console.
authorBruno Haible <bruno@clisp.org>
Mon, 13 Feb 2023 22:05:20 +0000 (23:05 +0100)
committerBruno Haible <bruno@clisp.org>
Mon, 13 Feb 2023 22:05:20 +0000 (23:05 +0100)
The Solaris 11 console prints garbage when a hyperlink is output.
Tested on Solaris 11.4/x86 and Solaris 11 OmniOS/x86.

* libtextstyle/gnulib-local/lib/term-ostream.oo.c (should_enable_hyperlinks):
Return false for the Solaris console.

libtextstyle/gnulib-local/lib/term-ostream.oo.c

index 33f46509d370a93d0c7946e7f8ed95408527b727..99d7c7e4d1ad1720b736813d48b37ed6515dc05f 100644 (file)
@@ -1,5 +1,5 @@
 /* Output stream for attributed text, producing ANSI escape sequences.
-   Copyright (C) 2006-2008, 2017, 2019-2020, 2022 Free Software Foundation, Inc.
+   Copyright (C) 2006-2008, 2017, 2019-2020, 2022-2023 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2006.
 
    This program is free software: you can redistribute it and/or modify
@@ -2354,6 +2354,15 @@ should_enable_hyperlinks (const char *term)
               return !known_buggy;
             }
         }
+
+      /* Solaris console.
+           Program                            | TERM      | Supports hyperlinks?
+           -----------------------------------+-----------+---------------------------
+           Solaris kernel's terminal emulator | sun-color | produces garbage
+           SPARC PROM's terminal emulator     | sun       | ?
+       */
+      if (strcmp (term, "sun") == 0 || strcmp (term, "sun-color") == 0)
+        return false;
     }
 
   /* In case of doubt, enable hyperlinks.  So this code does not need to change