How to check if stdin is pending in TCL?
问题 Consider the following code: chan configure stdin -blocking false while { true } { chan gets stdin if { chan blocked stdin } { break } } Here at the last line of the loop chan blocked stdin returns true in either cases: when there is no more input available at stdin , and when there there is some input available at stdin , but it doesn't end with a newline character. I need to distinguish these two cases. How can I do that? chan pending input stdin also returns 0 in both cases. Here is the