2
I have a minimal HTTP server written in python (http://pastebin.com/mjLDk7Gk) that simply answers every GET request with status 200 and body "Done".
If I do
wget "http://localhost:9001" -O - -q
Done
But if I leave out the -q:
wget "http://localhost:9001" -O -
--2015-01-12 15:28:20-- http://localhost:9001/
Resolving localhost (localhost)... 127.0.0.1
Connecting to localhost (localhost)|127.0.0.1|:9001... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified
Saving to: ‘STDOUT’
[<=> ] 0 --.-K/s D
[ <=> ] 4 --.-K/s in 0s
2015-01-12 15:28:20 (670 KB/s) - written to stdout [4]
#blank line here
At the end of the first "status bar" line there is a "D", it is in fact the first character of the desired output. I assume that the output is somewhere lost while refreshing the terminal. This also happens with longer response bodys.
Another observation: If I redirect the output to a file, it works again:
wget "http://localhost:9001" -O - > /tmp/file
cat /tmp/file
Done
It also happens with very wide terminals. The "status bar" is growing, but there's still only one character of the response body.
Is this a bug or a configuration fault somewhere on my side? I get identical behavior with gnome-terminal and xterm (on Ubuntu 14.04.1 LTS).
Are you sure it isn't the terminal truncating instead of wrapping the output? – Nifle – 2015-01-12T14:57:26.287
Please see the updated answer. – Jasper – 2015-01-12T15:39:55.843