Problem with console apps


(Andrey Fidrya) #1

Hi All,

In Xcode 8.3 beta print() stopped outputting unterminated lines:
https://bugs.swift.org/browse/SR-3827

I've retested with recently released beta 2 and the issue is still present.
Could anyone from dev team take a look at this issue please?
I'm worried that it will make into release because it makes working
with interactive console apps impossible.

Regards,
Andrey


(Andrey Fidrya) #2

A follow-up:
flushing stdout works in console, but not in Xcode.
Neither setbuf(stdout, nil) nor fflush(stdout) helps, so it appears
this is an Xcode issue.

import Darwin

setbuf(stdout, nil)
while true
{
    print("A question.")
    print("Your answer: ", terminator: "") // not printed
    //fflush(stdout)
    
    sleep(1)
    print("")
}

Regards,
Andrey

···

On 8 Feb 2017, at 20:04, Andrey Fidrya <af@zabiyaka.com> wrote:

Hi All,

In Xcode 8.3 beta print() stopped outputting unterminated lines:
https://bugs.swift.org/browse/SR-3827

I've retested with recently released beta 2 and the issue is still present.
Could anyone from dev team take a look at this issue please?
I'm worried that it will make into release because it makes working
with interactive console apps impossible.

Regards,
Andrey


(Jens Alfke) #3

In that case you should file bug report at http://bugreport.apple.com <http://bugreport.apple.com/>.
The xcode-users mailing list hosted at http://lists.apple.com <http://lists.apple.com/> is also a reasonable place to discuss Xcode issues (but not a substitute for a bug report.)

—Jens

···

On Feb 9, 2017, at 3:33 AM, Andrey Fidrya via swift-users <swift-users@swift.org> wrote:

Neither setbuf(stdout, nil) nor fflush(stdout) helps, so it appears
this is an Xcode issue.