Expand description
Detect and drain leftover stdin after a multi-line paste.
Terminals treat newlines in a paste as Enter, so the first prompt only sees the first line. Remaining lines must be consumed before the next prompt.
Functionsยง
- drain_
available_ stdin_ lines - Splits available stdin data into non-empty logical lines.
- read_
available_ stdin_ bytes - Reads all currently available stdin bytes without blocking when empty.
- read_
pastable_ line - Reads a task name from stdin, absorbing multi-line paste into one string.
- stdin_
has_ pending_ input - Returns true when stdin has data that can be read without waiting for the user.