New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
httpie output has lots of additional characters on windows #36
Comments
It does look like the colorama module could be a fairly simple way to address this: |
Bummed to find this bug, colored output would be nice. |
This should be fixed now. Thanks for the tip for It would be great if you could test it and provide feedback (I don't use Windows very often):
There is one remaining Windows-related issue (unicode in terminal #71). |
I've just tested with powershell, zsh & cmd.exe using Python 2.7 - seems to work perfectly. Thanks for the fix. |
Glad to hear that. Thanks for the feedback. |
I get the following warnings when running httpie under PyPy 1.6 :
I think that this is caused by PyPy (see http://mail.python.org/pipermail/pypy-commit/2011-April/049781.html) EDIT: Nevermind, these warnings are coming from Colorama. |
I'm still getting this using ActivePython 3.2.2.3 I ran the update command you listed and am still getting the same output as before. Am I missing anything? |
@dethstryke What is the output of
|
I'm sorry that I didn't notice this issue thread when making the pull request. Also when I named my fork, I didn't know that you have already included colorama in the project. However, the dev branch did not work for me. (http --version gives 0.2.6dev for me) As I mention in my pull request, I had to change the stdout writing to a single print statement to get it working. As a proof, here's a screenshot showing installation from the dev branch (on the left) and then from my fork (on the right): I also had to install 'requests' separately, because the one provided by pip didn't work on my system. But by installing requests directly from their git repo worked flawesly. I'm totally newbie with python, pip and colorama, and quite newbie also with github, so I'm sorry if this is just some Stupid User Error. But I still think that there is something wrong with outputting to the cmd.exe window, and my pull request seems to fix it. |
At a quick glance it would seem that a simple 'print output' (without any explicit encoding being done) works nicely on both Windows and OS X. I just want to understand the details involved - what would break if we were to remove the check for stdout.buffer and/or the encoding parts? |
@mieky Encoding the output ensures that unicode characters (like The color problem that some people are still seing on Windows is most likely caused by the fact that So, @cido's patch seems to solve the occasional color-related problems on Windows, but the output still needs to be encoded (somehow) to ensure that unicode works. It's quite tricky to solve it universally. Any help appreciated. |
@jkbr Is there any changes I need to make to my win cmd.exe to prettify the output? Since I've installed 0.2.6-dev and still I get escape codes.. |
Please try the current master:
|
@jkbr Thank you, that worked. |
This seems to be fixed in |
Thanks
|
I'm not sure if there was a regression of if there is some problem with my local terminal, but the most recent version is showing this behavior for me.
|
I just installed this on windows and am having the same issue as @mykwillis, but only in powershell. If I use httpie in the regular cmd prompt it looks fine. Windows 7 |
I notice that if I
as opposed to using the latest colorama (0.3.3), then I don't get the control characters in the output. It's not in color, but at least it's not garbled. So this is likely something to do with a change in colorama between 0.3.2 and 0.3.3 |
Just downgraded colorama to 0.3.2 based on @mykwillis suggestion and powershell output looks much better now. Thanks for the advice! |
Running
http GET httpie.org
on windows results in a load of extra characters being printed out:I'm guessing that these are escape codes that provide the colored output on other operating systems. Running
http -u GET httpie.org
results in correct (though monochrome) output.It'd be nice to get cross platform colored output like provided by clint.
The text was updated successfully, but these errors were encountered: