Skip to content

prompt, with completer, causes line state Wonkiness on Windows 10 when scroll buffer isn't empty #235

@riverar

Description

@riverar

Isn't completely clear if this is a prompt issue or not, but here's the repro:

  1. Fire up command prompt, ensure it's using the new conhost (Use legacy console not selected).
  2. Insert a bunch of stuff into the scroll buffer and ensure window scrolls a bit down before continuing
  3. Using the toolkit API, prompt for input with a completer attached
  4. Specify input
  5. Note line state starts to get Wonky(tm) after a few inputs (1 or more). May need to repeat steps 2-4 a few more times.

Animated gif showing me simplying typing A-E, hitting enter between each letter.
prompt

And the sample code

from prompt_toolkit import prompt
from prompt_toolkit.contrib.completers import WordCompleter
import sys

for i in range(50):
  print('--Scroll buffer filler--');
print('--End of scroll buffer filler--');

for i in range(5):
  html_completer = WordCompleter(['<html>', '<body>', '<head>', '<title>'])
  text = prompt('Prompt #%i: ' % i, completer = html_completer)
  print('Answer #%i: %s' % (i, text))

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions