-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vanishing cursor and prints to wrong lines #7479
Comments
Also tested this in the latest preview (1.3.2382.0), bug still exists there. |
If it helps diagnosis any, PDCurses may or may not ignore the actual console screen buffer size (depending from what is in the process's environment), may or may not explicitly move the cursor around when outputting lines in
|
@Ennea are you running the above python script with |
@zadjii-msft Okay, second edit, sorry about this... I went back to it and can also successfully reproduce it in CMD, running Python 3.8: import curses
def main(window):
_, width = window.getmaxyx()
curses.curs_set(0)
window.getkey()
curses.curs_set(1)
window.addstr(0, 0, '-' * width)
window.getkey()
curses.curs_set(0)
window.getkey()
curses.curs_set(1)
window.addstr(2, 0, '-' * (width - 1))
window.getkey()
curses.wrapper(main) What this sample script does, compared to the first one, is also hide the cursor first using |
oh man I'm having a faint memory of an issue where moving the cursor while the cursor was hidden at the end of a previous frame would cause us to fail to update it's location before printing the next conpty frame. I can't remember anything more about it off the top of my head though. Fortunately, we've got a great minimal repro here, so we should be able to turn that into a unittest as well. Thanks! |
Environment
Steps to reproduce
Run this sample Python script:
Expected behavior
The script prints a bunch of lines made up of dashes. The first, third and fourth span the entire width of the terminal, the second is one character short. After each print of a line, the cursor should be visible. For the first and second lines, it should be right after the line (wrapped to the second row in case of the first one). For the third and fourth, the cursor is manually moved to the next row.
Actual behavior
Using Windows Terminal, the cursor does not show after printing the first line. It does after printing the second. It again does not after printing the third, and does show again after printing the fourth and last. Additionally, the lines are printed to row 0, 1, 4 and 5, instead of the expected 0, 2, 4 and 6.
Additional info
This one is weird. Originally I only wanted to file a bug for the vanishing cursor. When constructing some sample script, I also ran into the issue where successive prints also ended up on the completely wrong lines. So the cursor seems to vanish when printing just as many characters to fill the terminal's width, so that the cursor has to wrap to the next line. Printing one less or one more does not make the cursor vanish. Manually moving it to the first column after printing such a full line will also not fix this, but moving it to the second column will show it again. And for some reason, even though I provide both
y
andx
(in that order) toaddstr
in my sample script, Windows Terminal will not print these strings to the correct rows/lines.The text was updated successfully, but these errors were encountered: