Skip to content
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

[SR-3827] Lines without terminator aren't printed (regression) #46412

Closed
swift-ci opened this issue Feb 2, 2017 · 5 comments
Closed

[SR-3827] Lines without terminator aren't printed (regression) #46412

swift-ci opened this issue Feb 2, 2017 · 5 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. standard library Area: Standard library umbrella

Comments

@swift-ci
Copy link
Collaborator

swift-ci commented Feb 2, 2017

Previous ID SR-3827
Radar rdar://30308088
Original Reporter zmeyc (JIRA User)
Type Bug
Status Closed
Resolution Done
Environment

OS X, Xcode Version 8.3 beta (8W109m)

Additional Detail from JIRA
Votes 3
Component/s Standard Library
Labels Bug, 3.1Regression
Assignee None
Priority Medium

md5: 59241053894703477ec8dc6f73558394

Issue Description:

Upd: this appears to be Xcode output pane issue.

To reproduce, paste the following code to Playground:

print("A question.")
print("Your answer: ", terminator: "")

"Your answer: " will not appear in Xcode 8.3 beta.
Works as expected in Xcode 8.2.

Flushing stdout doesn't help. We're using a workaround below, but it causes flickering:

for _ in 0...10000  { print("\0", terminator: "") }
@swift-ci
Copy link
Collaborator Author

swift-ci commented Feb 8, 2017

Comment by Andrey Fidrya (JIRA)

Also reproducible on Xcode 8.3 beta 2.

@swift-ci
Copy link
Collaborator Author

swift-ci commented Feb 9, 2017

Comment by Andrey Fidrya (JIRA)

Upd: 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: "")
    //fflush(stdout)
    
    sleep(1)
    print("")
}

@swift-ci
Copy link
Collaborator Author

Comment by Andrey Fidrya (JIRA)

Has been fixed in Xcode 9.

@hartbit
Copy link
Collaborator

hartbit commented Apr 19, 2019

@belkadan I know this is an old issue, but I'm noticing the same behaviour in Swift 5, even in the console. Should we reopen this issue or open a new one?

@belkadan
Copy link
Contributor

New one, I guess. I suspect you're talking about printing without manual flushing (y/n?), so the question is really "should printing with a custom terminator force flushing", and the standard library folks probably have opinions on that.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. standard library Area: Standard library umbrella
Projects
None yet
Development

No branches or pull requests

3 participants