2 ms·
It would be really nice if curl took the content-type and results from isatty(STDOUT_FILENO) into consideration when deciding whether to spew to stdout.
by wyldfire 12y ago
It would be really nice if curl took the content-type and results from isatty(STDOUT_FILENO) into consideration when deciding whether to spew to stdout.
- acqq 12y agoYes, I can't imagine there are actual scripts dumping binary data to the terminal, and it would help everybody whose terminal would otherwise experience what viraptor nicely describes: ""curl http://..." http://...", screen is filled with garbage, ctrl-c, ctrl-c, ctrl-c, damn I'm on a remote host and ssh needs to catch up, ctrl-c, "cur...", actually terminal is broken and I'm writing garbage now, "reset", "wget http://..."." http://..."." I admit it happened to me more than once.
- kybernetyk 12y agoFor debugging home made servers it's quiet nice (if you don't want to wireshark): curl -silent http://i.imgur.com/0nCbgbi.jpg |hexdump -C |less Now you could automate this for testing, etc. There are use cases for terminal output and changing this behavior now would probably wreck many 3rd party scripts. And if you really just want a simple download manager you probably should use wget anyways.
- wtetzner 12y agoThe thing is, you might want to pipe the output to something else instead of saving it to a file. If you check that you're outputting to a terminal, then the terminal behavior is different than the pipe behavior, which might be confusing. Maybe if it's a terminal print a warning with a simple explanation, or a Y/N prompt?