Hi Rajula
Hey
On Sat, Aug 12, 2017 at 12:56 AM, Rajula Vineet <[hidden email]> wrote:
Hey,
I have been trying to print on the command line as a part of my handler
implementation. I have been using `nextPutAll: aString;lf.` Apparently, 'lf'
does not seem to work. I tried 'cr' too. I am using the latest 7.0 Pharo-vm
and pharo image. I tried 'OSPlatform current lineEnding' as suggested by
Clement Mastin. But, when I used the 6.0 version the 'lf' message is working
fine.
We did some changes to remodularize a bit more the kernel some weeks ago.
The correct way to print a line ending is, as Clement pointed out, 'OSPlatform current lineEnding'. That is because there is no portable character for a new line. Each platform has its own.
Oh! Cool!
That said, maybe you found a bug :). Since the image before automatically transformed cr's in line endings for a platform, I did a stream decorator that replaces that behaviour for Pharo 7, I just did it to make it work, did not test it further actually.
Oh! Yeah, it might be a bug.
Could you try the following?
- seeing what happens if you print a new line twice?
nextPutAll: aString; lf;lf
I tried it out, it is not changing anything. No new line.
- What is the stream you're using to print out? Transcript or Stdout? Could you show the entire expression you're using?
Yeah, I am using stdout. This is the expression
self stdoutnextPutAll: (SystemVersion current highestUpdate) asString;lf.
- Can you print out the stream you're using?
stream nextPutAll: stream asString; lf.
Yeah, the stream I am using is a VTermOutputDriver.
Guille
Rajula
Please find the attached image which demonstrates the same. The left
terminal is of version 7.0, right one is of 6.0. Can someone help me out
with this?
<http://forum.world.st/file/n4960327/Screenshot_from_2017-08-11_00-04-29.png>
--
View this message in context: http://forum.world.st/New-line-on-command-line-tp4960327.html
Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.
--
Guille Polito
Research Engineer
French National Center for Scientific Research - http://www.cnrs.fr
Web: http://guillep.github.io
Phone: +33 06 52 70 66 13