Add a note about why we play with file descriptors
This commit is contained in:
parent
f8991ce3c8
commit
5338fcdc1e
1 changed files with 2 additions and 0 deletions
|
|
@ -495,6 +495,8 @@ def main(args: List[str]) -> Response:
|
|||
loop.loop(phandler)
|
||||
return {'items': items, 'response': phandler.response}
|
||||
|
||||
# we do this file descriptor dance to get readline to work even when STDOUT
|
||||
# is redirected
|
||||
orig_stdout = os.dup(sys.stdout.fileno())
|
||||
try:
|
||||
with open(os.ctermid(), 'r') as tty:
|
||||
|
|
|
|||
Loading…
Reference in a new issue