-
Notifications
You must be signed in to change notification settings - Fork 124
Closed
Description
Provide developers a function for reading input with the following signature:
def read_input(self, prompt: str, enable_completion: bool = False) -> str
The name isn't set in stone.
Difference between this function and the existing _pseudo_read_input
- Raises
EOFErrorexceptions instead returning the stringeof - Turns off tab completion by default
_pseudo_read_input will be replaced by something similar to the following:
def _read_command_line(self, prompt: str) -> str:
try:
# Wrap in try since terminal_lock may not be locked
try:
# Command line is about to be drawn. Allow asynchronous changes to the terminal.
self.terminal_lock.release()
except RuntimeError:
pass
return self.read_input(prompt, enable_completion=True)
except EOFError:
return 'eof'
finally:
# Command line is gone. Do not allow asynchronous changes to the terminal.
self.terminal_lock.acquire()GnikDroy