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
Fix display of plain text containing multiple carriage returns before line feed #2561
Conversation
I've just been experimenting with this, and came up with some confusing results. After staring at that regex for about twenty minutes, I concluded that it'd only take an extra carriage return.
Whilst this fixed the adb output, it didn't work well when I tested it, so I ran the same test in the unmodified Notebook, and got confusing output there too. This is from the modified version...
I then repeated this in the unmodified Notebook...
Maybe I'm totally missing something, but that seems all wrong to me. Whilst neither work, the modified version does seem to work under normal use, when it doesn't have to deal with crazy line endings. |
Don't forget Python appends your system newline (presumably Running commands using Here's what I see from your test script, both with %run and !python, on this branch:
Because the print statement appends
Again, that's what I'd expect - the Mac line gets killed by the lone |
Oh, hang on, you were talking about your modified version. That would go wrong. Dissecting your regex:
My change (which I was testing), splits it into two regexes:
|
(And I must withdraw my earlier criticism of adb - presumably it just hardcodes Windows line endings, and then it's pexpect which is transforming |
Thanks for killing this one Thomas. I never learnt regular expressions, so I appreciate you sorting this. Nice one. |
@Carreau @ellisonbg - As I don't often do notebook stuff, I'd like someone who does to give this a once over before I merge it. It's a 2-line change, so it should be quick. Thanks! |
haven't tried, but I don't see any reason not to merge it if it helps on android. |
Fix display of plain text containing multiple carriage returns before line feed
…iage returns before line feed Closes gh-2560
Fix display of plain text containing multiple carriage returns before line feed
Closes gh-2560