How to clear a specific line with NCurses?
19,985
Solution 1
You can position on the line you want to clear and then call clrtoeol
function.
Solution 2
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
Solution 3
maybe crltoeol would do the trick
Author by
Kristina Brooks
I do stuff. Mostly interested in low level things. Some notable ones: Open source firmware for Raspberry Pi's VPU (VideoCore4): https://github.com/christinaa/rpi-open-firmware Writing an LLVM backend for VideoCore4: https://github.com/christinaa/LLVM-VideoCore4 Porting XNU/Darwin to various ARMv7 boards (for example, the OMAP3 base BeagleBoard) Implementing a Mach-like IPC system inside the Linux kernel
Updated on June 13, 2022Comments
-
Kristina Brooks about 2 years
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?