diff options
author | Tobias Burnus <tobias@codesourcery.com> | 2019-12-07 08:24:14 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2019-12-07 09:24:14 +0100 |
commit | ae169f9e4cbb5a1f1767106d86f322d166d5189d (patch) | |
tree | bc227a76e9eda94d057f2a26ce5d2480c388e9b0 /gcc | |
parent | b69877c60d2e1ebc1922042974565cad15c6a23c (diff) | |
download | gcc-ae169f9e4cbb5a1f1767106d86f322d166d5189d.zip gcc-ae169f9e4cbb5a1f1767106d86f322d166d5189d.tar.gz gcc-ae169f9e4cbb5a1f1767106d86f322d166d5189d.tar.bz2 |
re PR c/87488 (hyperlink filenames in diagnostics)
PR c/87488
* pretty-print.c (pp_begin_url, pp_end_url, test_urls): Use BEL
instead of ST sequence to terminate OSC 8 strings.
Co-Authored-By: David Malcolm <dmalcolm@redhat.com>
Co-Authored-By: Jakub Jelinek <jakub@redhat.com>
From-SVN: r279073
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/pretty-print.c | 11 |
2 files changed, 15 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 09cba3d..0eda8e0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2019-12-07 Tobias Burnus <tobias@codesourcery.com> + David Malcolm <dmalcolm@redhat.com> + Jakub Jelinek <jakub@redhat.com> + + PR c/87488 + * pretty-print.c (pp_begin_url, pp_end_url, test_urls): Use BEL + instead of ST sequence to terminate OSC 8 strings. + 2019-12-06 Andreas Krebbel <krebbel@linux.ibm.com> Vladimir Makarov <vmakarov@redhat.com> diff --git a/gcc/pretty-print.c b/gcc/pretty-print.c index c57a3db..3aa2c4b 100644 --- a/gcc/pretty-print.c +++ b/gcc/pretty-print.c @@ -2043,7 +2043,10 @@ identifier_to_locale (const char *ident) > > OSC 8 ; ; ST > - > OSC (operating system command) is typically ESC ]. */ + > OSC (operating system command) is typically ESC ]. + + Use BEL instead of ST, as that is currently rendered better in some + terminal emulators that don't support OSC 8, like konsole. */ /* If URL-printing is enabled, write an "open URL" escape sequence to PP for the given URL. */ @@ -2052,7 +2055,7 @@ void pp_begin_url (pretty_printer *pp, const char *url) { if (pp->show_urls) - pp_printf (pp, "\33]8;;%s\33\\", url); + pp_printf (pp, "\33]8;;%s\a", url); } /* If URL-printing is enabled, write a "close URL" escape sequence to PP. */ @@ -2061,7 +2064,7 @@ void pp_end_url (pretty_printer *pp) { if (pp->show_urls) - pp_string (pp, "\33]8;;\33\\"); + pp_string (pp, "\33]8;;\a"); } #if CHECKING_P @@ -2369,7 +2372,7 @@ test_urls () pp_begin_url (&pp, "http://example.com"); pp_string (&pp, "This is a link"); pp_end_url (&pp); - ASSERT_STREQ ("\33]8;;http://example.com\33\\This is a link\33]8;;\33\\", + ASSERT_STREQ ("\33]8;;http://example.com\aThis is a link\33]8;;\a", pp_formatted_text (&pp)); } } |