19

How to clear a specific line with NCurses?

I need to wipe a line on the screen without redrawing the whole thing. How do I do that?

4 Answers 4

27

You can position on the line you want to clear and then call clrtoeol function.

Sign up to request clarification or add additional context in comments.

Comments

23

This is how I ended up doing it for my purposes.

int y, x; // to store where you are getyx(stdscr, y, x); // save current pos move(y, 0); // move to begining of line clrtoeol(); // clear line move(y, x); // move back to where you were 

1 Comment

any chance you know how to do this in vertical scope? meaning clear all lines until last line
3

maybe crltoeol would do the trick

Comments

0

If you want to clear all lines from the cursor until the last line, you can call clrtobot()

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.