Title: window.delch() for virtual screen
Tags: python;python-curses
Question: When I use window.delch(y, x) in curses, python, the delete will happen on the screen, rather than the virtual screen, that is, the character will be deleted even if I don't call window.refresh(). Why is that, and how would I delete the character only on the virtual screen?


Here is another answer: If you could provide some sample code that reproduces your issue, that would be helpful.  The behavior of windows, as far as I can reproduce, is that delch() will not update the screen until refresh() has been called.  See my sample code which demonstrates this:
import curses
import time
stdscr = curses.initscr()
curses.noecho()
curses.cbreak()
stdscr.keypad(True)
stdscr.addch(1, 1, ord('a'))
time.sleep(1)
stdscr.refresh()
stdscr.delch(1, 1)
time.sleep(3)
stdscr.refresh()
time.sleep(1)
curses.echo()
curses.nocbreak()
stdscr.keypad(False)
curses.endwin()
Comment for this answer: I will add a sample code tomorrow, I fixed the issue but the code is a bit uglier now.

{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2016:00:01/20/16', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<python><python-curses>', 'Title': 'window.delch() for virtual screen', 'ViewCount': 315, 'id': 34912032, 'user_AboutMe': '<p>The best. Just not at programming.</p>\n', 'user_AccountId': 6089787.0, 'user_DisplayName': 'Emlingur', 'user_Reputation': 163.0, 'user_Views': 4.0, 'user_id': 5196007.0}}