wresize(3NCURSES)
π wresize β bestie edition π
okay so this is wresize from the ncurses library calls club, and she is the girl for making a curses window change its whole shape. no cap. π¦
πΈ NAME πΈ
wresize β resize a curses window π
β¨ SYNOPSIS β¨
#include <curses.h>
int wresize(WINDOW * win, int lines, int columns);
π DESCRIPTION π
okay so wresize is an ncurses extension to the curses library β meaning she's not in the og lineup, she's the bonus track β and what she does is reallocate storage for win, adjusting its dimensions to lines and columns. iconic behavior honestly.
and here's the cute part: if either dimension is bigger than its current value, ncurses fills the expanded part of the window with the window's background character, exactly as configured by wbkgdset(3NCURSES). and if you're living in the wide-character API era? that's wbkgrndset(3NCURSES) for you, bestie. π
π RETURN VALUE π
wresizereturnsOKon success π- and
ERRon failure π
she fails if either lines or columns is less than or equal to zero, or if an error happens while (re)allocating memory for win. so yeah, memory said no, and she respects that. π
π§ NOTES π§
the only restriction placed on the values of lines and columns is that they be greater than zero. that's it. that's the whole vibe check.
they are not compared to the dimensions of the curses screen β and that's on purpose, because it keeps the logic of resizeterm(3NCURSES) simple. π«Ά
but bestie, listen: the caller must ensure that win's dimensions fit within those of the screen. that part is on you, not her. π
π₯ EXTENSIONS π₯
wresize is an ncurses(3NCURSES) extension, and is not found in SVr4 curses, 4.4BSD curses, or any other previous curses implementation. she's built different, fr fr. β
π PORTABILITY π
applications employing ncurses extensions should condition their use on the visibility of the NCURSES_VERSION preprocessor macro. like, check before you use her, she's not everywhere. π§
NetBSD curses adopted wresize in 2001 (release 1.5.3), and PDCurses in 2004 (version 2.7). so she did eventually go mainstream. we love a glow-up. β¨
and lowkey important: it is not possible to resize windows with SVr4 curses. nope. not a thing. don't try it. π
π HISTORY π
Thomas Dickey developed wresize as an extension to BSD curses in 1988, and brought it to ncurses in mid-1995. a true main character moment across two whole eras. π
π AUTHORS π
Thomas Dickey π«Ά
π¦ SEE ALSO π¦
resizeterm(3NCURSES)
okay that's the whole page!! and a lil sign-off for you: this was ncurses 6.6, dated 2025-01-18, and yes she ate. go resize something responsibly, bestie. 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-2010,2015 Free Software Foundation, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms