Open asmeurer opened 5 years ago
Hi @asmeurer,
This looks like a bug indeed. Are you sure that it happens with the latest prompt_toolkit on the 2.0 branch? I remember doing a fix related to this some time ago.
I don't mind merging a fix that checks an environment variable like PROMPT_TOOLKIT_NO_CPR=1
in prompt_toolkit/input/vt100.py
, in the responds_to_cpr
method. This could solve it.
(Either create PR against master, or against both master and 2.0.)
I just checked and it still occurs in the latest 2.0 branch. It's only inside pexpect. I've never seen it in the normal terminal.
PR for the environment variable at https://github.com/prompt-toolkit/python-prompt-toolkit/pull/897 and https://github.com/prompt-toolkit/python-prompt-toolkit/pull/898.
I am getting this from trying to use pexpect with IPython. If I comment out the
assert
, it showsWARNING: your terminal doesn't support cursor position requests (CPR).
. So I think the assertion is preventing the warning from being displayed correctly. I don't know why the app isn't running, but regardless whether that's a bug on my end or prompt-toolkit's it should not prevent the warning from being displayed.As a side question, do you know how to properly use prompt-toolkit 2.0 with pexpect? Is there a way to disable the CPR checks entirely? Maybe an environment variable would be useful for this.