Skip to content

The warning output gets mangled by the progress meter #4422

@combor

Description

@combor

I did this

Hi, I'm having problems hiding the progress bar but keeping the warings on the screen.
With such command I'm getting only the last error:

curl -Lkf --connect-timeout 5 \
    --max-time 10 \
    --retry 5 \
    --retry-max-time 40 \
    --show-error \
    --silent \
    --output /tmp/response \
    -w "Requested URL: %{url_effective}\nResponse code: %{http_code}\n" \
    'https://httpstat.us/503'

Requested URL: https://httpstat.us/503
Response code: 503
curl: (22) The requested URL returned error: 503 Service Unavailable

If I remove --silent I'm getting this:

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
Warning: Transient problem: HTTP error Will retry in 1 seconds. 5 retries
Warning: left.
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
Warning: Transient problem: HTTP error Will retry in 2 seconds. 4 retries
Warning: left.
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
Warning: Transient problem: HTTP error Will retry in 4 seconds. 3 retries
Warning: left.
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
Warning: Transient problem: HTTP error Will retry in 8 seconds. 2 retries
Warning: left.
^C

Or this ( no new lines before Warning) - depends on the error type:

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0Warning: Transient problem: timeout Will retry in 1 seconds. 5 retries left.
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0Warning: Transient problem: timeout Will retry in 2 seconds. 4 retries left.
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0Warning: Transient problem: timeout Will retry in 4 seconds. 3 retries left.
^C

How can I hide the progress bar? After some googling it seems like the most wanted feature on the internet :)

Maybe the new flag can be introduced? Something like --do-not-ever-show-me-the-progress-bar-as-i-know-what-im-doing ?

I expected the following

Warning: Transient problem: timeout Will retry in 1 seconds. 5 retries left.
Warning: Transient problem: timeout Will retry in 2 seconds. 4 retries left.
Warning: Transient problem: timeout Will retry in 4 seconds. 3 retries left.
...
curl: (22) The requested URL returned error: 503 Service Unavailable

curl/libcurl version

curl 7.54.0 (x86_64-apple-darwin18.0) libcurl/7.54.0 LibreSSL/2.6.5 zlib/1.2.11 nghttp2/1.24.1
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz HTTP2 UnixSockets HTTPS-proxy

operating system

Darwin GBML242731 18.7.0 Darwin Kernel Version 18.7.0: Tue Aug 20 16:57:14 PDT 2019; root:xnu-4903.271.2~2/RELEASE_X86_64 x86_64

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions