curs_deleteln(3X)
β¨ curs_deleteln β delete or insert lines in a curses window β¨
okay bestie, welcome to curs_deleteln(3X), a library call situation π
this is where you get to yeet lines out of a window or shove brand new ones in, and honestly? iconic behavior.
πΈ NAME πΈ
deleteln, wdeleteln, insertln, winsertln, insdelln, winsdelln β delete or insert lines in a curses window π«Ά
π SYNOPSIS π
#include <curses.h>
int deleteln(void);
int wdeleteln(WINDOW * win);
int insertln(void);
int winsertln(WINDOW * win);
int insdelln(int n);
int winsdelln(WINDOW * win, int n);
π DESCRIPTION π
so here's the tea, one function at a time π
wdeleteln deletes the line at the cursor in win, and every line below it moves up one line. then curses fills the bottom line of win with the background character that you set up with wbkgdset(3X) β and if you're on the wide-character API, that's wbkgrndset(3X) for you, no cap. the cursor position? does not change. it stays exactly where it was, main character energy π
winsertln inserts a new, empty line of characters above the line at the cursor in win, shifting all the existing lines down by one. heads up though: the content of the window's bottom line is lost π and curses fills that new line with the background character. cursor position does not change. again. so consistent.
winsdelln inserts or deletes n lines in win β inserts when n is positive, deletes when n is negative β as if you'd just called winsertln or wdeleteln over and over and over. and winsdelln(..., 0)? performs no operation. it's giving "I'm just here for the vibes" π
π₯ RETURN VALUE π₯
these functions return OK on success and ERR on failure. simple as that β¨
in ncurses, they fail if win is NULL. (like, bestie, you have to actually give them a window.)
π NOTES π
all of these functions except winsdelln may be implemented as macros. surprise mechanics, iykyk π
these functions do not require the terminal to have hardware line deletion or insertion capabilities. and even if the terminal does have them? by default curses does not use them β go peek at idlok(3X) if you wanna know more. it's a whole thing.
π¦ PORTABILITY π¦
X/Open Curses Issue 4 describes these functions. it specifies no error conditions for them. so likeβ¦ nothing to worry about there, apparently π«
SVr4 describes a successful return value only as βan integer value other than ERRβ. that's it. that's the whole description. so vague. so mysterious. we love that for them π
β HISTORY β
4BSD in 1980 introduced deleteln, wdeleteln, insertln, and winsertln. pioneers fr fr π
SVr3.1 in 1987 added insdelln and winsdelln. and then there were six.
π SEE ALSO π
curses(3X)
and that's the whole page, bestie!! this was ncurses 6.6, dated 2025-07-05 β go forth and delete and insert lines responsibly π β¨π¦
π¦ where this page comes from
- alpine 3.24: ncurses-doc 6.6_p20260516-r0 Β· X11
- arch rolling: ncurses 6.6-2 Β· MIT-open-group
- fedora 44: ncurses-devel 6.6-1.fc44 Β· MIT-open-group
- fedora 44: ncurses-devel 6.6-1.fc44 Β· MIT-open-group
- Copyright 2018-2024,2025 Thomas E. Dickey
- Copyright 1998-2007,2010 Free Software Foundation, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms