From 74ef692c9c4db176865548f1f1690ee283ecd92d Mon Sep 17 00:00:00 2001 From: Aaron Meurer Date: Tue, 14 May 2019 13:04:21 -0600 Subject: [PATCH] Add PROMPT_TOOLKIT_NO_CPR=1 environment variable to disable CPR requests See https://github.com/prompt-toolkit/python-prompt-toolkit/issues/886#issuecomment-490274914. --- prompt_toolkit/input/vt100.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/prompt_toolkit/input/vt100.py b/prompt_toolkit/input/vt100.py index 5fcceb095..dd60d82b0 100644 --- a/prompt_toolkit/input/vt100.py +++ b/prompt_toolkit/input/vt100.py @@ -69,6 +69,8 @@ def __init__(self, stdin): def responds_to_cpr(self): # When the input is a tty, we assume that CPR is supported. # It's not when the input is piped from Pexpect. + if os.environ.get('PROMPT_TOOLKIT_NO_CPR', '') == '1': + return False return self.stdin.isatty() def attach(self, input_ready_callback):