-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix bug #81280 refuse to allow unicode chars in prompts #7333
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
Conversation
I've done a bit of digging ... my version of libedit does not support wide chars, however there have been patched versions of readline and or libedit that may handle unicode characters. In the "official" source it's not supported, and since it may result in a fault, we should disable wide chars by default as this patch does for consistency. My version of libedit does not even allow me to input unicode characters, and so the patch for phpdbg is not strictly needed. I don't know how libedit/readline may behave elsewhere, so I've duplicated the behavior for phpdbg. |
Any info on what breaks in libedit with utf-8? This seems super weird to me in that I'd expect unicode to work here if you simply didn't do anything special for it. |
This is a trace from my version of editline/libedit, it's old enough (but the default in ubuntu 20.10) that it simply doesn't have unicode support implemented - this is a well documented problem in many projects. The source code for a version of libedit/editline at https://thrysoee.dk/editline/ says and reads like it supports unicode. The problem seems to be that there are several different versions of editline/libedit and there's no good way to tell what features are available, short of doing a build test in config. Since I don't view this as especially important to support where libedit/editline is able, it seems valuable for behavior to be consistent. |
bump @nikic FTR I looked at doing an AC_TRY_RUN like test to determine if the libedit/editline/readline being used would fault, however it doesn't look possible (in a portable way) to provide stdin to the test binary, and since readline() will block it doesn't look like we can test as part of configure process. |
Ta, merged as a2e0519 |
Fixes https://bugs.php.net/bug.php?id=81280, https://bugs.php.net/bug.php?id=76989.