Skip to content

Curses programming: cursor handled incorrectly #4102

@thautwarm

Description

@thautwarm

Environment

Windows build number: Microsoft Windows [Version 10.0.19041.1]
Windows Terminal version : Version: 0.7.3451.0

CPython: 3.7.4
CPython package curses(Windows-curses)

Steps to reproduce

Open cmd or PowerShell inside Windows Terminal, with python run

def main():
    window = curses.initscr()
    curses.noecho()
    curses.nonl()
    curses.nocbreak()
    curses.raw()
    window.keypad(False)
    x = 0
    y = 0
    while True:
        window.refresh()
        c = window.getch()
        window.addstr(0, 0, str(c))
        if c == ord('q'):
            return
        elif c == ord('a'):
            x = 10
        elif c == ord('b'):
            y = 10
        else:
            x = 0
            y = 0
            pass

        window.move(y, x)
try:
    main()
finally:
    curses.endwin()

Expected behavior

Press a, the cursor move to (0, 10) immediately.

Actual behavior

After pressing a, the cursor doesn't move to (0, 10) immediately, i.e., the screen show doesn't change at all. Then after an another pressing, the cursor moves to (0, 10).

P.S:

  • Expected behavior is according to the package curses bundled in Python of Linux distros.
  • Things work perfectly when we use cmd or PowerShell without Windows Terminal.

zephyrproject-rtos/windows-curses#7

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-VTVirtual Terminal sequence supportIssue-BugIt either shouldn't be doing this or needs an investigation.Priority-2A description (P2)Product-ConptyFor console issues specifically related to conptyResolution-Fix-CommittedFix is checked in, but it might be 3-4 weeks until a release.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions