-
-
Notifications
You must be signed in to change notification settings - Fork 139
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
[macOS] Prompt escape sequences error #40
Comments
Details please? OS, terminal, locale? It's as per the color coding guidelines already so I am expecting your terminal has something in play here. |
Hey,
Terminal: iTerm2
OS: macOS 10.13.2
shell environment variables
````
TERM=xterm-256color
````
and `locale` gives...
````
LANG="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_CTYPE="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_ALL="en_US.UTF-8"
````
Does that help?
…On Sun, Dec 10, 2017 at 9:51 PM, Arun Prakash Jana ***@***.*** > wrote:
On my machine
Details please? OS, terminal, locale?
It's as per the color coding guidelines already so I am expecting your
terminal has something in play here.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#40 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AHMMn5qLrTHtKu0RWvDRMu0dARvFF6kxks5s_JiqgaJpZM4Q8rD5>
.
|
I believe this is the same as jarun/googler#203. We had a patch in and then we had to revert it back due to glaring side-effects. At this point we don't have any other graceful way to handle it. One way would be to disable readline but that would be telling on user experience. |
What do you see if you run the following python3 snippet?
|
Given this is the second time this issue is reported, I am working on a way to handle this. I will add the support for an environment variable, which, if defined, will render a plain prompt. Even if the issue is not widespread, it can put-off several users... so it's better to have a way to avoid it. |
Hey @jarun , I know I meant to response ... but obviously I forgot! Running your snippet with python3 yield this: 7mddgr (? for help)[0m EDIT: I just tried the dev release and the result is the same. EDIT2: To be perfectly clear, it's definitely not the terminal emulator (iTerm2) nor the environment. The escape sequences are interpreted properly when used in message='ddgr (? for help)'
printf '\x1b[7m%s\x1b[0m' "${message}" This gives the expected inverted colored face/background. EDIT: @jarun solved! I did not have the proper python readline extension installed. So...maybe you just need to test for that? |
We have introduced a new env var to disable the prompt color:
It should work in all cases whatever the readline version is. |
With that said, one could set an alias like this: |
Hey there @jarun , great project!
Small bug i've noticed is that, after conducting a search, the ddgr prompt is a bit funny due to possible syntax error.
On my machine I get this literal string for the prompt:
[7mddgr (? for help)[0m
The code, should be something like this:
'\e[7mddgr (? for help)\e[0m
The text was updated successfully, but these errors were encountered: