Add a note about why we play with file descriptors

This commit is contained in:
Kovid Goyal
2023-01-26 21:50:10 +05:30
parent f8991ce3c8
commit 5338fcdc1e

View File

@@ -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: