-
-
Notifications
You must be signed in to change notification settings - Fork 529
incorrect encoding of prompt #203
Comments
Your terminal emulator doesn't support reverse video ( |
I use iterm2 (https://www.iterm2.com/) but the OS X default terminal has the same issue.. |
That doesn't sound right at all. I'm an iTerm2 user on macOS. Please run
and upload |
Actually,
would be easier. |
here's the output: |
something that might help - If I pbpaste the output of yes q | \googler hello | pbcopy then the characters are encoded correctly... |
Prints just fine here. iTerm2 3.1.20170919-nightly, macOS 10.12.6. You might want to check this on a clean VM if you can. |
Okay that's something. But this is not an "encoding" issue; it's not like |
UTF-8 xterm256 is my setup as well. I'll report back if I manage to fix it just in case someone else runs into this. Thanks for the help! |
Another way to debug that I can think of is to use iTerm2's session logging. It logs every character printed to the terminal verbatim, so that's something to check. To enable, go to Profiles->Session->Miscellaneous->Automatically log session input to files in:. |
Thanks. I will take a proper look when I find the time. For now I modified the line of code so it won't do reverse video. Feel free to close this, looks like it's an issue with my system anyway. |
You don't need to modify the code. You can set the prompt to a host of color/styles other than reverse video. Read https://github.com/jarun/googler#colors. |
Closing for now. Let us know if there's anything wrong with our code. |
ok so this issue seems to be beyond reverse color. Using the --colors I can change all colors except for the prompt colors. For example: googler --colors GKlgxa will give a prompt like this: or googler t --colors GKlgxj |
What happens if you set the prompt to normal?
|
And please try the |
The only thing different about this prompt (from other colored stuff) is it's wrapped in an #!/usr/bin/env python3
input('\x1b[31mThis is a red prompt: \x1b[0m') |
OK. In order to narrow it down, what happens if you just run Also, do you use any alias to run googler? Run |
In addition to my comment above, can you check if the following patch makes any difference?
I can't think of any reason why it should yet, still... |
yes I'm using an alias (alias news='googler -n 5 -N --url-handler reader'). But executing /usr/local/bin/googler gives the prompt: I tried the patch but still same result. Googler is working great for me except for this issue- which I can work around it by changing that line of code (to have no colors at all in the prompt). But I'm happy to keep on helping debug this is you think there's a problem with the code and you would like to pursue it... |
What happens if you add the color codes manually to the message (instead of using the colors subsystem)? Does it show correctly? |
I think the problem is input(). check this: https://bugs.python.org/issue17337 |
Unfortunately, I can't reproduce this myself to test anything. I'll have to bank on you and @zmwangx to figure out something. In any case, this isn't critical so I'm fine even if we don't have a patch. |
Supposedly fixes jarun#203 where the ANSI escape sequences in the prompt are messed up, an issue which couldn't be reproduced by the maintainers. bpo-17337 [1] may be related. [1] https://bugs.python.org/issue17337 Signed-off-by: Zhiming Wang <[email protected]>
@urielz I hope the latest commit provides you a better experience. |
@jarun thank you! yes this works. |
My pleasure! |
Googler 3.3 is working for me on OS X Capitan except that the prompt is a bit messed up (see screenshot) Any tips on how to fix this? Thanks!
The text was updated successfully, but these errors were encountered: