Skip to content

header values also shown in bold #2736

Closed
@l2dy

Description

@l2dy

I did this

curl -I https://curl.haxx.se
screen shot 2018-07-12

I expected the following

bold-headers-terminal

curl/libcurl version

curl 7.61.0 (x86_64-apple-darwin17.7.0) libcurl/7.61.0 OpenSSL/1.0.2o zlib/1.2.11 libidn2/2.0.5 libpsl/0.20.2 (+libidn2/2.0.5) nghttp2/1.32.0
Release-Date: 2018-07-11
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp 
Features: AsynchDNS IDN IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP HTTP2 UnixSockets HTTPS-proxy PSL 

operating system

macOS 10.13.6, curl installed from MacPorts, shell is fish.

Activity

bagder

bagder commented on Jul 12, 2018

@bagder
Member

It seems the mac terminal doesn't do "bold off" so it sticks with bold! This is independent of what shell that's used.

bagder

bagder commented on Jul 12, 2018

@bagder
Member

An alternative approach that probably is more portable is to switch off all "styles":

diff --git a/src/tool_cb_hdr.c b/src/tool_cb_hdr.c
index 88ce5e13b..d317b9f39 100644
--- a/src/tool_cb_hdr.c
+++ b/src/tool_cb_hdr.c
@@ -40,11 +40,11 @@ static char *parse_filename(const char *ptr, size_t len);
 #ifdef WIN32
 #define BOLD
 #define BOLDOFF
 #else
 #define BOLD "\x1b[1m"
-#define BOLDOFF "\x1b[21m"
+#define BOLDOFF "\x1b[0m"
 #endif
 
 /*
 ** callback for CURLOPT_HEADERFUNCTION
 */
added a commit that references this issue on Jul 12, 2018
48ba5ea
grawity

grawity commented on Jul 17, 2018

@grawity

For the record, the more common unbold sequence is \e[22m. That's the one found in Xterm's documentation for example. I don't know where \e[21m came from. Resetting all styles is even more reliable, I guess.

eli-schwartz

eli-schwartz commented on Jul 17, 2018

@eli-schwartz
Contributor

Using guake on Linux (vte) I was getting lots of double-underlined everything, which bled into the prompt after curl was finished: https://paste.xinu.at/MeNlxzN/

(So, not just macOS.)

But this commit fixes it.

lotheac

lotheac commented on Jul 18, 2018

@lotheac

@grawity xterm's documentation is actually at http://invisible-island.net/xterm/ctlseqs/ctlseqs.html (and it documents \e[21m too):

CSI Pm m  Character Attributes (SGR).
        Ps = 2 1  -> Doubly-underlined (ECMA-48).
bagder

bagder commented on Jul 20, 2018

@bagder
Member

A fix has already landed! We don't need more details on the error but we could use some confirmations of the fix...

eli-schwartz

eli-schwartz commented on Jul 20, 2018

@eli-schwartz
Contributor

But this commit fixes it.

21 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @ilatypov@grawity@kilobyte@lotheac@bagder

        Issue actions

          header values also shown in bold · Issue #2736 · curl/curl