fowlball1010
fowlball1010

Reputation: 383

PyCharm Your Terminal Doesn't Support Cursor Position Requests (CPR)

I have the following python code I'm testing out in PyCharm Professional 2021.1.2:

from prompt_toolkit import prompt
from prompt_toolkit.history import FileHistory
from prompt_toolkit.auto_suggest import AutoSuggestFromHistory
from prompt_toolkit.completion import WordCompleter
import os

CmdCompleter = WordCompleter(['hello', 'goodnight'])


while 1:
    user_input = prompt('>',
                        history=FileHistory(os.path.expanduser('~/.repl_history')),
                        auto_suggest=AutoSuggestFromHistory(),
                        completer=CmdCompleter)
    print(user_input)

PyCharm is running on my Windows host and is configured to use a remote SSH Interpreter on a Debian 10 VM. When I go to run the application, I get WARNING: your terminal doesn't support cursor position requests (CPR). within the PyCharm run window. Running the code natively in the Linux VM causes no issues. Is there any configuration, setting, or option I can change to get the output in the PyCharm run window to appear/work correctly?

Upvotes: 1

Views: 1332

Answers (1)

Ayush Garg
Ayush Garg

Reputation: 2517

When testing on PyCharm personally, I got an error:

prompt_toolkit.output.win32.NoConsoleScreenBufferError: No Windows console found. Are you running cmd.exe?

I don't know why you got a warning but I got an error, but in order to fix this, I just went to Configuration settings and checked Emulate terminal in output console:

edit configurations

emulate terminal in output console

I hope that this fixes the problem!

Upvotes: 1

Related Questions