-
-
Notifications
You must be signed in to change notification settings - Fork 30.2k
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 Big Sur input() removes colors #113533
Comments
The one of the answers to the stackoverflow question indicates there's little we can do here: readline on macOS uses the system libedit and apparently that's broken for this feature. |
That said, the stackoverflow question also documents a way to fix the libedit sources and the fix they mention can probably be used to implement a hot fix by directly calling some native libedit APIs (not through its readline implementation). |
I also tried to write prompt through |
I was too positive here. The EditLine instance used in the readline emulation is private to that library and cannot be accessed which means we cannot work around this. This is a bug in the system version of libedit, the version at https://www.thrysoee.dk/editline/ does not have this bug. |
Looks like readline on my system does not use libedit (from otool)
|
What's the output of |
output 1:
output 2:
I see it now. I got python3 from homebrew. |
Bug report
Bug description:
Providing screenshot because of colors:
More details:
The same code works on Linux Ubuntu LTS and both
input()
andprint()
are colored.NOTE:
\001
and\002
are necessary for preventing libreadline from breaking prompt on tab completion. However removing them fixes the problem with colors. Unfortunately I can't go without them because otherwise libreadline breaks prompt:Thanks in advance,
Ivan Nikolskiy (@enty8080)
CPython versions tested on:
3.11
Operating systems tested on:
macOS
The text was updated successfully, but these errors were encountered: