ins_wch(3NCURSES)
π ins_wch β bestie, we're inserting a complex character β¨
(that's ins_wch, wins_wch, mvins_wch, mvwins_wch from the 3NCURSES library calls crew π)
πΈ NAME πΈ
ins_wch, wins_wch, mvins_wch, mvwins_wch β insert a curses complex character in a window π
π¦ SYNOPSIS π¦
#include <curses.h>
int ins_wch(const cchar_t * wch);
int wins_wch(WINDOW * win, const cchar_t * wch);
int mvins_wch(int y, int x, const cchar_t * wch);
int mvwins_wch(WINDOW * win, int y, int x, const cchar_t * wch);
β¨ DESCRIPTION β¨
okay so wins_wch inserts the curses complex character wch at the cursor position in the window win. iconic
the character that was previously at the cursor β and literally everything to its right β moves one cell to the right π«Ά. and the character that used to be the rightmost one on the line? bestie, it's discarded π gone, not coming back.
and here's the thing that makes it different from add_wch(3NCURSES): wins_wch does not advance the cursor. not even a little. nope. stay put, king π
ncurses(3NCURSES) is where you go to read about the variants of this function, iykyk.
π RETURN VALUE π
these functions return OK when things go right and ERR when they don't π
in ncurses specifically, they return ERR if:
- the curses screen has not been initialized, or
- (only for the functions that take a
WINDOWpointer argument)winis a null pointer π«
also! the functions prefixed with "mv" first do cursor movement, and they fail if the position (y, x) is outside the window boundaries. no cap.
π NOTES π
ins_wch,mvins_wch, andmvwins_wchmay be implemented as macros π- curses does not necessarily employ the terminal's
insert_character(ich1) capability to achieve insertion. it might, it might not. that's just the vibe.
π PORTABILITY π
X/Open Curses Issue 4 describes these functions π. it specifies no error conditions for them. wild, right?
π HISTORY π
X/Open Curses Issue 4 (1995) initially specified these functions β
the System V Interface Definition Version 4 of the same year specified a function named winswch (plus the usual variants). this was a later addition to SVr4.x β it did not appear in the first SVr4 (1989). π
it differed from X/Open's later wins_wch in that it took an argument of type chtype instead of cchar_t. subtle but real π
π₯ SEE ALSO π₯
insch(3NCURSES)β describes comparable functions in the non-wide-character curses configurationncurses(3NCURSES)terminfo(5)
and that's the whole page, bestie π«Ά this was ncurses 6.6, dated 2025-10-20 β go insert some complex characters, you absolute main character πβ¨π
π¦ 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 2019-2024,2025 Thomas E. Dickey
- Copyright 2002-2010,2017 Free Software Foundation, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms