Cygwin's pty's are based on pipes. Therefore, when it interacts with a Win32 program (such as Win32 python), what that program sees is a pipe instead of a console. This is important because python buffers pipes, and so on a pty-based terminal, text will not necessarily appear immedi
(prompt)
| 248 | |
| 249 | |
| 250 | def compat_input(prompt): |
| 251 | """ |
| 252 | Cygwin's pty's are based on pipes. Therefore, when it interacts with a Win32 |
| 253 | program (such as Win32 python), what that program sees is a pipe instead of |
| 254 | a console. This is important because python buffers pipes, and so on a |
| 255 | pty-based terminal, text will not necessarily appear immediately. In most |
| 256 | cases, this isn't a big deal. But when we're doing an interactive prompt, |
| 257 | the result is that the prompts won't display until we fill the buffer. Since |
| 258 | raw_input does not flush the prompt, we need to manually write and flush it. |
| 259 | |
| 260 | See https://github.com/mintty/mintty/issues/56 for more details. |
| 261 | """ |
| 262 | sys.stdout.write(prompt) |
| 263 | sys.stdout.flush() |
| 264 | try: |
| 265 | # This is unused directly when the user pastes the cross-device |
| 266 | # verification code, which may be longer than some terminal's buffers |
| 267 | import readline # noqa: F401 |
| 268 | |
| 269 | return raw_input() |
| 270 | except ImportError: |
| 271 | LOG.debug('readline module not available') |
| 272 | return raw_input() |
| 273 | |
| 274 | |
| 275 | def compat_shell_quote(s, platform=None, shell=False): |
no test coverage detected