xref: /freebsd/usr.bin/resizewin/resizewin.1 (revision 4757b351ea9d59d71d4a38b82506d2d16fcd560d)
1.\"
2.\" SPDX-License-Identifier: BSD-2-Clause
3.\"
4.\" resizewin
5.\"
6.\" Query terminal for size and inform the kernel
7.\"
8.\" Copyright 2015 EMC / Isilon Storage Division
9.\"
10.\" Redistribution and use in source and binary forms, with or without
11.\" modification, are permitted provided that the following conditions
12.\" are met:
13.\" 1. Redistributions of source code must retain the above copyright
14.\"    notice, this list of conditions and the following disclaimer.
15.\" 2. Redistributions in binary form must reproduce the above copyright
16.\"    notice, this list of conditions and the following disclaimer in the
17.\"    documentation and/or other materials provided with the distribution.
18.\"
19.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
20.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
23.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29.\" SUCH DAMAGE.
30.\"
31.Dd May 9, 2017
32.Dt RESIZEWIN 1
33.Os
34.Sh NAME
35.Nm resizewin
36.Nd update terminal size
37.Sh SYNOPSIS
38.Nm
39.Op Fl z
40.Sh DESCRIPTION
41The
42.Nm
43utility
44queries the terminal emulator for the current window size and updates
45the size known to the kernel using the
46.Dv TIOCSWINSZ
47ioctl.
48.Pp
49The following options are available:
50.Bl -tag -width "-z"
51.It Fl z
52Do nothing unless the current kernel terminal size is zero.
53This is useful when run from a user's profile (shell startup) scripts:
54querying the window size is required for serial lines, but not when
55logging in over the network, as protocols like TELNET or SSH already
56handle the terminal size by themselves.
57.El
58.Pp
59After a terminal window has been resized, running
60.Nm
61updates the kernel's window size to match the new size.
62.Pp
63.Nm
64is functionally similar to
65.Xr resize 1 ,
66which is part of the
67.Xr xterm 1 Pq Pa ports/x11/xterm
68distribution.
69However,
70.Nm
71only works with VT100/ANSI-compatible terminals and does not emit
72commands to set environment variables.
73.Pp
74The terminal is assumed to be VT100/ANSI compatible.
75The VT100/ANSI escape sequences are supported by virtually all modern
76terminals, including xterm, konsole, gnome-terminal, iTerm,
77Terminal.app, and PuTTY.
78.Sh SEE ALSO
79.Xr stty 1 ,
80.Xr tty 4
81.Sh HISTORY
82The
83.Nm
84command first appeared in
85.Fx 11.0 .
86