-
Notifications
You must be signed in to change notification settings - Fork 280
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
flush stdin before asking for input #658
Conversation
So I noticed in bloom that sometimes the messages which are printed to stdout before one of these prompts never gets displayed. I'm not sure I can reproduce it, but it has definitely happened. |
But do you think it is related to the stdin flushing? |
I do actually, this is an example of what I am talking about:
There should be two other Maybe we should flush stdout before truncating the stdin? I can try that locally and see if that make a difference. |
def _flush_stdin(): | ||
try: | ||
from termios import tcflush, TCIOFLUSH | ||
tcflush(sys.stdin, TCIOFLUSH) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually shouldn't this line be:
tcflush(sys.stdin, TCIFLUSH)
@wjwwood Can you please give it a try with my previous comment on changing |
I'll give it a try now. |
+1 |
flush stdin before asking for input
Same as ros-infrastructure/bloom#249.
@wjwwood Please review.