cURL / Mailing Lists / curl-users / Single Mail

curl-users

Prevent/confirm before dumping binary data to terminal?

From: Ramesh Dharan <r_at_meshdharan.com>
Date: Mon, 24 Feb 2014 16:25:05 -0500

Hi folks,

I’m curious if anyone has ever proposed an option to make curl behave similar to less with respect to binary data; i.e. when writing binary data to a TTY, first confirm with a prompt:

$ curl http://example.com/somelargebinary.gz
Output may be binary data. Print anyway?

I have the habit of using curl to both inspect website HTML content and download large files, and in the latter case I often forget to pass the -o/-O option and end up with an unresponsive, corrupted terminal as a large amount of binary data is written to it and escape sequences are processed etc. And of course this is particularly painful when I make the mistake in an SSH session. I’m envisioning an off-by-default option to enable the prompt, which I could stick it in my ~/.curlrc.

Perhaps I’m the only one foolish enough to frequently suffer from this problem?

--Ramesh
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2014-02-25