Use ctermid() instead of hardcoding /dev/tty

This commit is contained in:
Kovid Goyal
2018-08-04 20:58:01 +05:30
parent 05b817f5f5
commit d964146f8c
6 changed files with 14 additions and 8 deletions

View File

@@ -381,7 +381,7 @@ def main(args):
return
else:
text = sys.stdin.buffer.read().decode('utf-8')
sys.stdin = open('/dev/tty')
sys.stdin = open(os.ctermid())
try:
args, items = parse_hints_args(args[1:])
except SystemExit as e: