writeLine() with console is (literally) breaking when the string is "too long"? #4051

Closed
Xunnamius opened this Issue Mar 16, 2013 · 4 comments

Projects

None yet

3 participants

@Xunnamius

These images are worth a thousand words; red is the code that produces the corresponding orange output:

1

2

These numbers... and I'm not in the mood to dive into the ZF2 source tonight ;)

Moreover, the workaround seems to be two consecutive write()s (or one long write()). I see it happening pretty much everywhere where the strings are too long, although it doesn't occur often enough for me to replace all of my writeLine()s with consecutive write()s.

Latest Debian Linux using the default console adapter shipped w/ ZF2.

@Thinkscape
Member

Fixed. After merging it will work as expected, echoing the text with an EOL, unless the text matches console width - in that case no EOL will be sent to prevent empty lines.

@Xunnamius Xunnamius closed this Mar 17, 2013
@Bittarman
Member

Please do not close until the PR is merged

@Bittarman Bittarman reopened this Mar 17, 2013
@Xunnamius

Sorry about that, meant to comment again.

Perhaps I'm simply doing it wrong, but after testing the patch locally I'm still seeing issues. Namely, newline characters seem to be getting eaten when executing code similar to the following: $console->writeLine(print_r($somearr, true));.

@Thinkscape
Member

Thanks. I'll check it.

@weierophinney weierophinney added a commit that referenced this issue Mar 28, 2013
@weierophinney weierophinney Merge branch 'hotfix/4055'
Close #4055
Fixes #4051
c32e962
@weierophinney weierophinney added a commit to zendframework/zend-console that referenced this issue May 15, 2015
@weierophinney weierophinney Merge pull request zendframework/zendframework#4055 from Thinkscape/h…
…otfix/console-writeline

Fix zendframework/zendframework#4051 console::writeLine()
946ec8e
@weierophinney weierophinney added a commit to zendframework/zend-console that referenced this issue May 15, 2015
@weierophinney weierophinney Merge branch 'hotfix/4055' acef74d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment