xref: /freebsd/usr.bin/resizewin/resizewin.1 (revision fa9896e082a1046ff4fbc75fcba4d18d1f2efc19)
13d222369SConrad Meyer.\" resizewin
23d222369SConrad Meyer.\"
33d222369SConrad Meyer.\" Query terminal for size and inform the kernel
43d222369SConrad Meyer.\"
53d222369SConrad Meyer.\" Copyright 2015 EMC / Isilon Storage Division
63d222369SConrad Meyer.\"
73d222369SConrad Meyer.\" Redistribution and use in source and binary forms, with or without
83d222369SConrad Meyer.\" modification, are permitted provided that the following conditions
93d222369SConrad Meyer.\" are met:
103d222369SConrad Meyer.\" 1. Redistributions of source code must retain the above copyright
113d222369SConrad Meyer.\"    notice, this list of conditions and the following disclaimer.
123d222369SConrad Meyer.\" 2. Redistributions in binary form must reproduce the above copyright
133d222369SConrad Meyer.\"    notice, this list of conditions and the following disclaimer in the
143d222369SConrad Meyer.\"    documentation and/or other materials provided with the distribution.
153d222369SConrad Meyer.\"
163d222369SConrad Meyer.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
173d222369SConrad Meyer.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
183d222369SConrad Meyer.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
193d222369SConrad Meyer.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
203d222369SConrad Meyer.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
213d222369SConrad Meyer.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
223d222369SConrad Meyer.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
233d222369SConrad Meyer.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
243d222369SConrad Meyer.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
253d222369SConrad Meyer.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
263d222369SConrad Meyer.\" SUCH DAMAGE.
2736acabc1SBaptiste Daroussin.\"
28df2a34c0SEdward Tomasz Napierala.Dd May 9, 2017
293d222369SConrad Meyer.Dt RESIZEWIN 1
303d222369SConrad Meyer.Os
313d222369SConrad Meyer.Sh NAME
323d222369SConrad Meyer.Nm resizewin
33df2a34c0SEdward Tomasz Napierala.Nd update terminal size
34f1504c0cSEdward Tomasz Napierala.Sh SYNOPSIS
35f1504c0cSEdward Tomasz Napierala.Nm
36f1504c0cSEdward Tomasz Napierala.Op Fl z
373d222369SConrad Meyer.Sh DESCRIPTION
38df2a34c0SEdward Tomasz NapieralaThe
39df2a34c0SEdward Tomasz Napierala.Nm
40df2a34c0SEdward Tomasz Napieralautility
41df2a34c0SEdward Tomasz Napieralaqueries the terminal emulator for the current window size and updates
42df2a34c0SEdward Tomasz Napieralathe size known to the kernel using the
433d222369SConrad Meyer.Dv TIOCSWINSZ
44df2a34c0SEdward Tomasz Napieralaioctl.
45f1504c0cSEdward Tomasz Napierala.Pp
46f1504c0cSEdward Tomasz NapieralaThe following options are available:
47f1504c0cSEdward Tomasz Napierala.Bl -tag -width ".Fl z"
48f1504c0cSEdward Tomasz Napierala.It Fl z
49f1504c0cSEdward Tomasz NapieralaDo nothing unless the current kernel terminal size is zero.
50980e53a2SEdward Tomasz NapieralaThis is useful when run from a user's profile (shell startup) scripts:
51df2a34c0SEdward Tomasz Napieralaquerying the window size is required for serial lines, but not when
52df2a34c0SEdward Tomasz Napieralalogging in over the network, as protocols like TELNET or SSH already
53df2a34c0SEdward Tomasz Napieralahandle the terminal size by themselves.
54f1504c0cSEdward Tomasz Napierala.El
55f1504c0cSEdward Tomasz Napierala.Pp
56df2a34c0SEdward Tomasz NapieralaAfter a terminal window has been resized, running
57df2a34c0SEdward Tomasz Napierala.Nm
58df2a34c0SEdward Tomasz Napieralaupdates the kernel's window size to match the new size.
59df2a34c0SEdward Tomasz Napierala.Pp
603d222369SConrad Meyer.Nm
613d222369SConrad Meyeris functionally similar to
623d222369SConrad Meyer.Xr resize 1 ,
633d222369SConrad Meyerwhich is part of the
64*825225e5SJens Schweikhardt.Xr xterm 1 Pq Pa ports/x11/xterm
653d222369SConrad Meyerdistribution.
663d222369SConrad MeyerHowever,
673d222369SConrad Meyer.Nm
6850bc66f4SEdward Tomasz Napieralaonly works with VT100/ANSI-compatible terminals and does not emit
6950bc66f4SEdward Tomasz Napieralacommands to set environment variables.
703d222369SConrad Meyer.Pp
71df2a34c0SEdward Tomasz NapieralaThe terminal is assumed to be VT100/ANSI compatible.
72df2a34c0SEdward Tomasz NapieralaThe VT100/ANSI escape sequences are supported by virtually all modern
73980e53a2SEdward Tomasz Napieralaterminals, including xterm, konsole, gnome-terminal, iTerm,
742dc39caaSKurt LidlTerminal.app, and PuTTY.
753d222369SConrad Meyer.Sh SEE ALSO
76df2a34c0SEdward Tomasz Napierala.Xr stty 1 ,
77df2a34c0SEdward Tomasz Napierala.Xr tty 4
783d222369SConrad Meyer.Sh HISTORY
792dc39caaSKurt LidlThe
803d222369SConrad Meyer.Nm
812dc39caaSKurt Lidlcommand first appeared in
82df2a34c0SEdward Tomasz Napierala.Fx 11.0 .
83