Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upbpython breaks line with ANSI escape code #670
Comments
|
While I managed to get over the previous issue: I really can't get things to work without this being fixed. I'd appreciate if you could fix it. |
|
@sebastinas @thomasballinger What do you think? Since no other REPLs has this issue, the inconsistency between them and bpython certainly brings undesired behavior to some libraries, which I think is a serious problem. |
|
Handling of escape characters happens in curtsies. So while this certainly is an issue that affects bpython, it needs to be fixed in curtsies. I think @thomasballinger wouldn't mind getting bug reports and/or test cases for that. |
|
Thanks to @ata2001 the second issue you mentioned https://github.com/thomasballinger/curtsies/issues/97 is fixed. Fixing length issues is possible via the wcwidth-based width of a curtsies FmtStr. https://github.com/thomasballinger/curtsies/issues/8 is the most relevant issue for this, we should consider this bpython issue blocked on that, because the version of curtsies currently used in bpython doesn't have this width. (probably because there's no released version of curtsies with a working |
|
Thanks guys. Looking forward to a new release. |
|
Test cases would not be bad for this, but I'd need some help with doing that. |
This can be easily reproduced by typing
In bpython

In Python

I guess when calculating the length of output, bpython counts all chars, but not all chars are visible, thus leading to this bug.