curs_delch(3X)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1

πŸ’– curs_delch(3X) πŸ’–

okay bestie, this is a library call page from the ncurses manual β€” the 3X bit at the end just means "section 3, X11/curses flavour," iykyk ✨


🌸 NAME 🌸

delch, wdelch, mvdelch, mvwdelch β€” delete a character from a curses window πŸ’…


✨ SYNOPSIS ✨

#include <curses.h>

int delch(void);
int wdelch(WINDOW * win);
int mvdelch(int y, int x);
int mvwdelch(WINDOW * win, int y, int x);

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the vibe: wdelch deletes the character sitting at the cursor position in win. 🎯

then β€” and this is the part people forget β€” it moves all the characters to the right of the cursor on the same line one position to the left. and the rightmost position on that line? it gets replaced with the window's background character. see bkgd(3X) for that (and if you're on the wide-character API, it's bkgrnd(3X) instead πŸ‘‘).

the cursor position does not change β€” well, after moving to (y, x) if you specified one, that is. don't be out here expecting it to scoot over or anything.

ncurses(3X) is where you go to read about all the variants of this function, fr fr. πŸ“–


πŸ’€ RETURN VALUE πŸ’€

these functions return OK on success and ERR on failure. simple as that, no cap. βœ…βŒ

in ncurses, these functions fail if:

  • the curses screen has not been initialized, or
  • (for the ones taking a WINDOW pointer argument) win is a null pointer.

and the ones prefixed with "mv" do cursor movement first, and they fail if the position (y, x) is outside the window boundaries. πŸ™ˆ


πŸŽ€ NOTES πŸŽ€

  • delch, mvdelch, and mvwdelch may be implemented as macros. so don't go doing anything cursed with them like taking their address, bestie. 😭
  • a terminal's delete_character (dch1) capability is not necessarily employed. like, it might not get used at all. just so you know. 🀷

🌈 PORTABILITY 🌈

X/Open Curses Issue 4 describes these functions. and it specifies no error conditions for them. iconic of it.

SVr4 describes a successful return value only as "an integer value other than ERR". that's it. that's the whole description. very demure, very minimal. πŸ’œ


⭐ HISTORY ⭐

SVr2 (1984) introduced wdelch. πŸ•°οΈ a true vintage queen.


🫢 SEE ALSO 🫢

  • curses(3X)

and that's the whole page, bestie!! this one's from ncurses 6.6, dated 2025-04-05 β€” go forth and delete characters responsibly πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from