()
| 381 | ) |
| 382 | |
| 383 | func stdinLineReader() *bufio.Reader { |
| 384 | if stdinReader == nil || stdinSource != os.Stdin { |
| 385 | stdinReader = bufio.NewReader(os.Stdin) |
| 386 | stdinSource = os.Stdin |
| 387 | } |
| 388 | return stdinReader |
| 389 | } |
| 390 | |
| 391 | // readLine reads a single line from stdin and accepts either \n or \r as the |
| 392 | // line ending. Terminals such as kitty on macOS send a bare \r when Enter is |