mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-27 02:31:45 +02:00
Add a note about why we play with file descriptors
This commit is contained in:
@@ -495,6 +495,8 @@ def main(args: List[str]) -> Response:
|
|||||||
loop.loop(phandler)
|
loop.loop(phandler)
|
||||||
return {'items': items, 'response': phandler.response}
|
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())
|
orig_stdout = os.dup(sys.stdout.fileno())
|
||||||
try:
|
try:
|
||||||
with open(os.ctermid(), 'r') as tty:
|
with open(os.ctermid(), 'r') as tty:
|
||||||
|
|||||||
Reference in New Issue
Block a user