Hacker News new | past | comments | ask | show | jobs | submit login

You can just delete the character out of the buffer and re-render the entire screen.

I've used apps which I suspect do this (not necessarily terminal emulators), and I'd strongly recommend against it; it may not be noticeable if your input rate isn't high, but if you lean on a key and let the keyboard auto-repeat, the rest of the screen/window, which hasn't changed, starts to noticeably flicker annoyingly.




These apps are getting more wrong than rendering too much on a single character change if there is visible flicker.

I wrote software that rendered its entire UI on any change into a DIB and blitted to the DC twenty years ago with no flicker


Maybe for some reason they clear the screen first before redrawing? That would certainly cause a flicker.


Not if they double buffer


In old school windows development, the mistake was normally to draw directly to the window's DC.


I could see that being especially troublesome in a system where you didn't have visibility into the repaint algorithm. Old skool UNIX used to start 'saving' damage events when they came in quickly so that it could dispatch them all at once. When your system did that you could lean on the delete (or backspace) key and it would start deleting characters and then just stop, and when you lifted the delete key it would suddenly have 15 - 20 whatever number of keys go away.

The other place it got annoying is when the system had a 'screen flash' when the input buffer was full. If your auto-repeat time was faster than the buffer drain time you would start getting flashes intentionally by the screen to tell you it was dropping input keys.

If you have one of the ST Micro 469i disco boards you can play with this using my 'term' demo in that repo. That implements a 25 x 80 "terminal" screen on the attached 800 x 480 screen. I've not yet connected it to micropython, but that is the intention.


> ... starts to noticeably flicker annoyingly

It's generally easy to solve problem with activating/implementing double buffering https://en.wikipedia.org/wiki/Multiple_buffering#Double_buff...




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: