deleteln(3NCURSES)
π deleteln, wdeleteln, insertln, winsertln, insdelln, winsdelln β the 3NCURSES besties π
okay so bestie. you know how sometimes a window has a line you simply cannot look at anymore and it has to GO? and sometimes you need a whole new blank line to show up like it manifested? yeah. this is that. line deletion and line insertion in a curses window. no cap. π
β¨ 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);
like literally that's it, that's the whole entrance exam π
πΈ DESCRIPTION πΈ
ποΈ wdeleteln β the "this line is over" function
wdeleteln deletes the line at the cursor in win, and every line below it just... moves up one line. like a queue where someone left. πΆβοΈ
then curses fills the bottom line of win with the background character that you configured with wbkgdset(3NCURSES) β and if you're on the wide-character API side of the group chat, that's wbkgrndset(3NCURSES) for you babes. π
and here's the thing that lowkey matters: the cursor position does not change. it just sits there, unbothered, main character energy. π
β winsertln β the "make room, new line incoming" function
winsertln inserts a new, empty line of characters above the line at the cursor in win, and it shifts all the existing lines down by one. push everybody down, bestie, we're making space. π«Ά
the content of the window's bottom line is lost β yeah, gone, sorry, it had to go π β and curses fills the new line with the background character.
and once again: the cursor position does not change. iconic behavior. no notes. β¨
ποΈ winsdelln β the "both, depending on the vibe" function
winsdelln inserts or deletes n lines in win depending on whether n is positive or negative. positive n = insert, negative n = delete. it's basically repeatedly calling winsertln or wdeleteln for you, like a friend who handles the group plan. π
and winsdelln(..., 0)? performs no operation. zero. nothing. it's giving "I'll be there in five minutes". π
π«§ RETURN VALUE π«§
these functions return OK when it works and ERR when it doesn't. slay or cry, no in-between. π
in ncurses, they fail if win is NULL. so like... maybe don't do that. π
β NOTES β
- all of these functions except
winsdellnmay be implemented as macros. so watch out, 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,
cursesdoes not use them. seeidlok(3NCURSES)for the whole tea. β
π PORTABILITY π
X/Open Curses Issue 4 describes these functions, and it specifies no error conditions for them. so like, it said nothing. silence. π€
SVr4 describes a successful return value only as βan integer value other than ERRβ. that's the whole description. an integer. not ERR. groundbreaking. π
π HISTORY π
- 4BSD (1980) introduced
deleteln,wdeleteln,insertln, andwinsertln. the originals. the OGs. π - SVr3.1 (1987) added
insdellnandwinsdelln. the sequels, and honestly they ate. π₯
π SEE ALSO π
ncurses(3NCURSES)
okay bestie that's the whole page, go forth and delete some lines πβ¨
this was brought to you by ncurses 6.6, dated 2025-07-05, and it's literally the deleteln(3NCURSES) page. periodt. π
ππ¦
π¦ where this page comes from
- ubuntu resolute: ncurses-doc 6.6+20251231-1 Β· MIT/X11
- ubuntu stonking: ncurses-doc 6.6+20260608-2 Β· MIT/X11
- 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