You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Okay, this looks like a case where cwcwidth fails to determine the length of a string with your locale. So: what's your locale? On the main branch you can also run bpython -l info -L log and check the file log for the version and environment variable output.
Thanks. \r shouldn't be contained in that string. I'll need to find out if some code path acts differently under iTerm2 that causes \r to be present. I suppose you are using the default config, right?
Yes, my sys.ps1 is configured. To be precise, it has ansi escapes in them. I added the /r just in case (pasting was getting wonky but now I figured it's Python's fault. I can change it back if I need to make this work)
Activity
ThatXliner commentedon May 9, 2021
Repro percentage: 100% (even after restarting my terminal)
(Possible) Repro steps:
Possibly useful:

sebastinas commentedon May 10, 2021
Are you using cwcwidth version 0.1.3 or newer?
ThatXliner commentedon May 10, 2021
How do I test that?
EDIT: Also, the issue is still reproducing
sebastinas commentedon May 10, 2021
pip freezeshould tell you. Otherwise:python -c "import cwcwidth; print(cwcwidth.__version__)"ThatXliner commentedon May 10, 2021
sebastinas commentedon May 12, 2021
Okay, this looks like a case where
cwcwidthfails to determine the length of a string with your locale. So: what's your locale? On themainbranch you can also runbpython -l info -L logand check the filelogfor the version and environment variable output.ThatXliner commentedon May 12, 2021
sebastinas commentedon May 13, 2021
Thanks.
\rshouldn't be contained in that string. I'll need to find out if some code path acts differently under iTerm2 that causes\rto be present. I suppose you are using the default config, right?ThatXliner commentedon May 13, 2021
No, I did quite some customizations (assuming you're referring to iTerm2)
sebastinas commentedon May 16, 2021
I meant your bpython config. Did you change its or Python's ps1 or ps2?
sebastinas commentedon May 16, 2021
Okay, I think I got it. Your
sys.ps1i set to\r>>>. I guess we need to strip\rin that case.ThatXliner commentedon May 16, 2021
Yes, my
sys.ps1is configured. To be precise, it has ansi escapes in them. I added the/rjust in case (pasting was getting wonky but now I figured it's Python's fault. I can change it back if I need to make this work)sebastinas commentedon May 16, 2021
At least the
\ris a problem. In any case, I'll fix it to not fail but ignore it in casebpythoncannot handle it.Replace ps1/ps2 with the default if values are not usable (fixes bpyt…