wresize(3X)
π wresize β from the 3X manual, library calls section π
okay bestie, gather round, because we're about to resize a curses window and it's literally the cutest little realloc you've ever seen π
β¨ NAME β¨
wresize β resize a curses window π¦
β¨ SYNOPSIS β¨
#include <curses.h>
int wresize(WINDOW * win, int lines, int columns);
β¨ DESCRIPTION β¨
so wresize is an ncurses extension to the curses library (iykyk, it's not in the old-school ones, more on that below π), and what it does is reallocate storage for win, adjusting its dimensions to lines and columns. glow-up for your window, no cap π
and if either dimension is bigger than its current value? ncurses fills that expanded part of the window with the window's background character, exactly as configured by wbkgdset(3X) β or, if you're on the wide-character API, by wbkgrndset(3X). so it's not just bigger, it's bigger and on-brand πΈ
β¨ RETURN VALUE β¨
OKβ slay, it worked, success πERRβ nope, failure π
it fails if either lines or columns is less than or equal to zero, or if an error pops off while (re)allocating memory for win. those are the two ways to lose, bestie.
β¨ NOTES β¨
okay so the only restriction 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(3X) simple. iconic design choice, honestly.
π«Ά so the caller must ensure thatwin's dimensions actually fit within those of the screen. that's a you problem, not awresizeproblem. no cap.
β¨ EXTENSIONS β¨
wresize is an ncurses(3X) extension, and it is not found in SVr4 curses, 4.4BSD curses, or any other previous curses implementation. it's giving ncurses-only, main character energy π
β¨ PORTABILITY β¨
if you're using ncurses extensions, bestie, you should condition their use on the visibility of the NCURSES_VERSION preprocessor macro. fr fr, do the #ifdef, your future self will thank you π
NetBSD curses adopted wresize in 2001 (release 1.5.3), and PDCurses in 2004 (version 2.7). so it's traveled a bit π
π and just so we're clear: it is not possible to resize windows with SVr4 curses. at all. periodt.
β¨ HISTORY β¨
Thomas Dickey developed wresize as an extension to BSD curses in 1988, and brought it to ncurses in mid-1995. a true legend, we stan π«Άβ¨
β¨ AUTHORS β¨
Thomas Dickey π
β¨ SEE ALSO β¨
resizeterm(3X)π
and that's the whole page, bestie!! this was the wresize(3X) manual from ncurses 6.6, dated 2025-01-18 β go forth and resize responsibly, mwah ππ
π
π¦ 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,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