curs_move(3X)
π curs_move(3X) β library calls, bestie edition π
okay so this is the curs_move page from the ncurses library calls section, and it's genuinely so useful it's not even funny. sit down, hydrate, let's talk about moving a cursor around a window π¦
β¨ NAME β¨
move, wmove β move the cursor in a curses window π
πΈ SYNOPSIS πΈ
#include <curses.h>
int move(int y, int x);
int wmove(WINDOW * win, int y, int x);
π DESCRIPTION π
so wmove relocates the cursor that's chillin' with the curses window win, and it puts it at line y and column x. that's it. that's the whole job. π«Ά
but here's the tea, bestie β the terminal's actual cursor does not move until you call refresh(3X). so you're basically doing a vibe-check move in the background and the terminal doesn't find out until refresh. it's giving secretive. π
the position (y, x) is relative to the upper left-hand corner of the window, and that corner has coordinates (0, 0). so like, top-left is home base, periodt. π
move is the same deal but it moves the cursor in the stdscr window instead. iconic sibling behaviour honestly. π
π RETURN VALUE π
these functions return OK on success and ERR on failure. slay when it works, π when it doesn't.
in ncurses, these functions fail if:
- the curses screen has not been initialized β like, you gotta set the whole thing up first, bestie, no skipping steps π
- (for
wmove)winis a null pointer β literally pointing at nothing, not the vibe π - the position
(y, x)is outside the window boundaries β you're trying to stand outside the window, that's not a thing, no cap β¨
β NOTES β
move may be implemented as a macro. so like, don't be weird about it, iykyk. π§
π₯ PORTABILITY π₯
X/Open Curses Issue 4 describes these functions. it specifies no error conditions for them. so like, the spec is out here being mysterious and vague and honestly? respect. π
SVr4 describes a successful return value only as "an integer value other than ERR". that's the whole description. that's all they gave us. the audacity. π
π HISTORY π
4BSD (1980) introduced these functions. so they've been eating since before most of us were born. generational. π
π¦ SEE ALSO π¦
curses(3X)curs_refresh(3X)
and that's the whole page!! brought to you by ncurses 6.6, dated 2025-04-05, from the curs_move(3X) manual. go move a cursor, bestie, you got this πβ¨π
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- Copyright 2018-2024,2025 Thomas E. Dickey
- Copyright 1998-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