Package: curl
Version: 7.61.0-1
Severity: normal

Dear Maintainer,

If I try to get the headers of an HTTP server with

$ curl -I http://www.debian.org

the output contains several terminal codes that make the answer look
cyan/double underlined (depending on the terminal).
This can be seen by using strace:

$ strace -e write curl -I http://www.debian.org
write(1, "HTTP/1.1 302 Found\r\n", 20HTTP/1.1 302 Found
)  = 20
write(1, "\33[1mDate\33[21m: Thu, 18 Oct 2018 "..., 46Date: Thu, 18 Oct 2018
17:31:23 GMT
) = 46
write(1, "\33[1mServer\33[21m: Apache\r\n", 25Server: Apache
) = 25
write(1, "\33[1mX-Content-Type-Options\33[21m:"..., 42X-Content-Type-Options:
nosniff
) = 42
write(1, "\33[1mX-Frame-Options\33[21m: sameor"..., 38X-Frame-Options:
sameorigin
) = 38
write(1, "\33[1mReferrer-Policy\33[21m: no-ref"..., 39Referrer-Policy: no-
referrer
) = 39
write(1, "\33[1mX-Xss-Protection\33[21m: 1\r\n", 30X-Xss-Protection: 1
) = 30
write(1, "\33[1mLocation\33[21m: https://www.d";..., 44Location:
https://www.debian.org/
) = 44
write(1, "\33[1mContent-Type\33[21m: text/html"..., 54Content-Type: text/html;
charset=iso-8859-1
) = 54
write(1, "\r\n", 2
)                     = 2
+++ exited with 0 +++

The problem is that those '\33[21m' are interpreted by the terminal making it
look weird even after curl is finished. In fact the same effect can be achieved
by giving the command:

$ echo -e '\e[21mfoobar'

To restore the terminal to its original state, I have to use either the command
'reset' or 'echo -e "\e[0m"'.

Other infos:

$ curl --version
curl 7.61.0 (x86_64-pc-linux-gnu) libcurl/7.61.0 OpenSSL/1.1.1 zlib/1.2.11
libidn2/2.0.5 libpsl/0.20.2 (+libidn2/2.0.5) libssh2/1.8.0 nghttp2/1.34.0
librtmp/2.3
Release-Date: 2018-07-11
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3
pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IDN IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL
libz TLS-SRP HTTP2 UnixSockets HTTPS-proxy PSL

$ apt-cache policy curl
curl:
  Installato: 7.61.0-1
  Candidato:  7.61.0-1
  Tabella versione:
 *** 7.61.0-1 500
        500 http://httpredir.debian.org/debian sid/main amd64 Packages
        500 https://mi.mirror.garr.it/mirrors/debian sid/main amd64 Packages
        500 https://mi.mirror.garr.it/mirrors/debian testing/main amd64
Packages
        100 /var/lib/dpkg/status

$ dpkg -l | grep curl
ii  curl                                  7.61.0-1
amd64        command line tool for transferring data with URL syntax
ii  libcurl3-gnutls:amd64                 7.61.0-1
amd64        easy-to-use client-side URL transfer library (GnuTLS flavour)
ii  libcurl4:amd64                        7.61.0-1
amd64        easy-to-use client-side URL transfer library (OpenSSL flavour)
ii  libcurl4-openssl-dev:amd64            7.61.0-1
amd64        development files and documentation for libcurl (OpenSSL flavour)
ii  libflickcurl0:amd64                   1.26-4
amd64        C library for accessing the Flickr API
ii  python-pycurl                         7.43.0.1-0.2+b1
amd64        Python bindings to libcurl
ii  python3-pycurl                        7.43.0.1-0.2+b1
amd64        Python bindings to libcurl (Python 3)

This problem doesn't occur with curl version 7.52.1 on Debian Stable.

Kind regards,

Marco Romano.



-- System Information:
Debian Release: buster/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.18.0-2-amd64 (SMP w/3 CPU cores)
Locale: LANG=it_IT.utf8, LC_CTYPE=it_IT.utf8 (charmap=UTF-8), 
LANGUAGE=it_IT.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages curl depends on:
ii  libc6     2.27-6
ii  libcurl4  7.61.0-1
ii  zlib1g    1:1.2.11.dfsg-1

curl recommends no packages.

curl suggests no packages.

-- no debconf information

Reply via email to