Skip to content

cursor position reset after scrolling screening when using 2.0 branch #570

@randy3k

Description

@randy3k

I have been using prompt-toolkit to develop a console for the R language: https://github.com/randy3k/Rice

Recently, I was told that the cursor position is automatically reset when a user tries to scroll screen via a terminal emulator: randy3k/radian#31

The following is a screenshot of the demonstration of the issue
jan-04-2018 00-59-52
The console was running on a terminal emulator of Sublime Text which uses pyte behind the scene. You can see that the cursor position is reset when I tried to scroll up the screen.

After some analyses, I have determined that the problematic code is related to a recent update
https://github.com/jonathanslenders/python-prompt-toolkit/blob/2.0/prompt_toolkit/key_binding/key_processor.py#L309

If that line is commented, the scrolling works as expected and the cursor position does not reset.
jan-04-2018 01-06-00

My guess is that prompt-toolkit somehow messes up the scroll up and down sequences <ESC>D and <ESC>M.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions