Skip to content

Fix screen and cursor flickering#201

Open
stianhoiland wants to merge 1 commit intojhawthorn:masterfrom
stianhoiland:pr-fix-flickering
Open

Fix screen and cursor flickering#201
stianhoiland wants to merge 1 commit intojhawthorn:masterfrom
stianhoiland:pr-fix-flickering

Conversation

@stianhoiland
Copy link
Copy Markdown

@stianhoiland stianhoiland commented Oct 25, 2025

Terminal redrawing should never clear before drawing

  • Instead set cursor to starting point, (over)write, then erase-from-cursor-to-end-of-line after outputting each line, and erase-to-end-of-screen after last output

Also hide cursor while redrawing and show again after

Terminal redrawing should never clear before drawing
  - Instead set cursor to starting point, (over)write, then erase-from-cursor-to-end-of-line after outputting each line, and erase-to-end-of-screen after last output
Also hide cursor while redrawing and show again after
for (size_t i = 0; i < state->cursor; i++)
fputc(state->search[i], tty->fout);
tty_flush(tty);
tty_showcursor(tty);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This leaves the cursor hidden for me, it needs to be called before tty_flush() to have an effect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants