Styled-output incorrectly uses double-underline attribute

Bug #1810471 reported by Luke Fielke
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
curl (Ubuntu)
Confirmed
Undecided
Unassigned
curl (openSUSE)
Fix Released
Medium

Bug Description

Using --styled-output (which is the default running cURL interactive terminal) results in the double-underline text attribute being set incorrectly and remaining on after cURL exits.

For example, running this in xfce4-terminal:
curl -I google.com

Results in double-underlined text starting from the ":" after "Location", and running into the shell prompt after cURL has exited.

The intended behaviour of this feature is HTTP header names to be bold, and header values to be normal.

While I noticed the problem in xfce4-terminal on Xubuntu, others have reported the issue on other terminal emulators, so I don't think this is specific to xfce4-terminal.

Man page for --styled-output doesn't mention setting double underline either:
    Enables the automatic use of bold font styles when writing HTTP headers to the terminal. Use --no-styled-output to switch them off.
              Added in 7.61.0.

This has already been fixed upstream by using the correct font attribute control code.

Upstream cURL bug report:
https://github.com/curl/curl/issues/2736

Fixed upstream in:
https://github.com/curl/curl/pull/2738

Revision history for this message
In , Kbabioch-b (kbabioch-b) wrote :

Created attachment 780410
Screenshot of messed up terminal

While using curl I've stumbled upon a bug, which messes up my terminal. The end result is that the characters are bold and double underlined (see attached screenshot for details). This stays even after the invocation of curl, so I have to actively reset the terminal after invoking curl.

I have the following version of curl installed:

kbabioch@aquarius:~> rpm -qi curl
Name : curl
Version : 7.61.0

It has something to do with "styled-output", i.e. it works fine with the option "no-styled-output".

stracing this, shows the following:

kbabioch@aquarius:~> strace -e write -s 120 curl -I registry.opensuse.org
write(1, "HTTP/1.1 301 Moved Permanently\r\n", 32HTTP/1.1 301 Moved Permanently
) = 32
write(1, "\33[1mContent-length\33[21m: 0\r\n", 28Content-length: 0
) = 28
write(1, "\33[1mLocation\33[21m: https://registry.opensuse.org/\r\n", 51Location: https://registry.opensuse.org/
) = 51
write(1, "\r\n", 2
) = 2
+++ exited with 0 +++

I'm using GNOME's terminal:

kbabioch@aquarius:~> rpm -qi gnome-terminal
Name : gnome-terminal
Version : 3.28.2

Revision history for this message
In , Matthias-gerstner (matthias-gerstner) wrote :
Revision history for this message
In , Kbabioch-b (kbabioch-b) wrote :

This fixes the problem, I've prepared a submission: https://build.opensuse.org/request/show/630909

Revision history for this message
In , Vcizek-l (vcizek-l) wrote :

Another problem that fixed itself :-)
Thanks for the report and the submission.

Closing, as the bug affects Tumbleweed only.

Revision history for this message
Luke Fielke (lfielke) wrote :
Changed in curl (openSUSE):
importance: Unknown → Medium
status: Unknown → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in curl (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.