File tree Expand file tree Collapse file tree 1 file changed +9
-11
lines changed Expand file tree Collapse file tree 1 file changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -76,22 +76,20 @@ most cases of *query-io* usage. Makes overloading y-or-no-p unnecessary.
7676 (let ((trimmed-output (copy-seq (string-trim ' (#\Bel ) output))))
7777 (when (or need-input
7878 (not (zerop (length (string-trim ' (#\Newline ) trimmed-output)))))
79+ (setf (fill-pointer (stdin-stream-input stream )) 0 )
7980 (setf (fill-pointer output) 0 )
8081 (finish-output )
8182 (send-input-request channel trimmed-output)
82- (do ()
83- ((message-available-p channel))
84- (sleep 0.1 ))
85- (let ((value (concatenate ' string
86- (gethash " value" (message-content (message-recv channel)))
87- ' (#\Newline ))))
88- (adjust-array input (length value)
89- :fill-pointer (length value)
90- :initial-contents (reverse value)))))
83+ (loop until (message-available-p channel)
84+ do (sleep 0.1 ))
85+ (loop for ch across (gethash " value" (message-content (message-recv channel)))
86+ initially (vector-push-extend #\Newline input)
87+ do (vector-push-extend ch input))))
9188 (bordeaux-threads :release-lock lock)))))
9289
93- (defmethod trivial-gray-streams :stream-finish-output ((stream stdin-stream))
94- (prompt-and-read stream nil ))
90+ (defmethod trivial-gray-streams :stream-clear-input ((stream stdin-stream))
91+ (setf (fill-pointer (stdin-stream-input stream )) 0 )
92+ nil )
9593
9694(defmethod trivial-gray-streams :stream-listen ((stream stdin-stream))
9795 (not (zerop (length (stdin-stream-input stream )))))
You can’t perform that action at this time.
0 commit comments