2 .\" Copyright (c) 2020 Soumendra Ganguly <soumendraganguly@gmail.com>
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
13 .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY
14 .\" EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE
17 .\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
20 .\" BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
21 .\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
22 .\" OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
23 .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 .\" Portions of this text are reprinted and reproduced in electronic form
26 .\" from P1003.1-202x, Draft 1.1, Draft Standard for Information Technology --
27 .\" Portable Operating System Interface (POSIX), The Open Group Base
28 .\" Specifications Issue 8, Copyright (C) 2020 by the Institute of
29 .\" Electrical and Electronics Engineers, Inc and The Open Group. In the
30 .\" event of any discrepancy between this version and the original IEEE and
31 .\" The Open Group Standard, the original IEEE and The Open Group Standard is
32 .\" the referee document. The original Standard can be obtained online at
33 .\" http://www.opengroup.org/unix/online.html.
41 .Nd get, set the size of a terminal window
48 unsigned short ws_row; /* number of rows, in characters */
49 unsigned short ws_col; /* number of columns, in characters */
50 unsigned short ws_xpixel; /* horizontal size, in pixels */
51 unsigned short ws_ypixel; /* vertical size, in pixels */
56 .Fn tcgetwinsize "int fd" "struct winsize *w"
58 .Fn tcsetwinsize "int fd" "const struct winsize *w"
62 function gets the terminal window size of the terminal of which
64 is an open file descriptor and stores it in the
72 function sets the terminal window size of the terminal of which
74 is an open file descriptor from the
76 structure referenced by
78 The change occurs immediately.
79 If the terminal window size of the terminal
80 is changed successfully to have a value that is different from the value that
85 signal is sent to all those members of the foreground process group of the
86 terminal that have the terminal as their controlling terminal.
88 The above declaration of
91 It is provided only to list the accessible members.
92 Therefore, before calling
96 structure must be initialized by calling
100 structure is stored by the kernel in order to provide a consistent interface,
101 but it is not used by the kernel.
103 .Rv -std tcgetwinsize tcsetwinsize
104 The terminal window size remains unchanged if
109 The following are the possible failure conditions:
118 is not a valid file descriptor.
126 is not associated with a character special device.
140 points outside the process's allocated address space.
153 functions are expected to conform to
155 Base Specifications, Issue 8.
162 are FreeBSD extensions.