📄 window.1
字号:
.\" Copyright (c) 1985, 1990, 1993.\" The Regents of the University of California. All rights reserved..\".\" This code is derived from software contributed to Berkeley by.\" Edward Wang at The University of California, Berkeley..\".\" Redistribution and use in source and binary forms, with or without.\" modification, are permitted provided that the following conditions.\" are met:.\" 1. Redistributions of source code must retain the above copyright.\" notice, this list of conditions and the following disclaimer..\" 2. Redistributions in binary form must reproduce the above copyright.\" notice, this list of conditions and the following disclaimer in the.\" documentation and/or other materials provided with the distribution..\" 3. All advertising materials mentioning features or use of this software.\" must display the following acknowledgement:.\" This product includes software developed by the University of.\" California, Berkeley and its contributors..\" 4. Neither the name of the University nor the names of its contributors.\" may be used to endorse or promote products derived from this software.\" without specific prior written permission..\".\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION).\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF.\" SUCH DAMAGE..\".\" @(#)window.1 8.2 (Berkeley) 12/30/93.\".Dd December 30, 1993.Dt WINDOW 1.Os BSD 4.3.Sh NAME.Nm window.Nd window environment.Sh SYNOPSIS.Nm window.Op Fl t.Op Fl f.Op Fl d.Op Fl e Ar escape-char.Op Fl c Ar command.Sh DESCRIPTION.Nm Windowimplements a window environment on.Tn ASCIIterminals..PpA window is a rectangular portion of the physical terminalscreen associated with a set of processes. Its size andposition can be changed by the user at any time. Processescommunicate with their window in the same way they normallyinteract with a terminal\-through their standard input, output,and diagnostic file descriptors. The window program handles thedetails of redirecting input and output to and from thewindows. At any one time, only one window can receiveinput from the keyboard, but all windows can simultaneously send outputto the display..PpWhen.Nm windowstarts up, the commands (see long commands below)contained in the file.Pa .windowrcin the user's home directory areexecuted. If it does not exist, two equal sized windows spanningthe terminal screen are created by default..PpThe command line options are.Bl -tag -width Fl.It Fl tTurn on terse mode (see.Ic tersecommand below)..It Fl fFast. Don't perform any startup action..It Fl dIgnore.Pa .windowrcand create the two defaultwindows instead..It Fl e Ar escape-char Set the escape character to.Ar escape-char ..Ar Escape-charcan be a single character, or in the form.Ic ^Xwhere.Ar Xis any character, meaning.No control\- Ns Ar X . .It Fl c Ar command Execute the string.Ar commandas a long command (see below)before doing anything else..El.PpWindows can overlap and are framed as necessary. Each windowis named by one of the digits ``1'' to ``9''. This one-characteridentifier, as well as a user definable label string, are displayedwith the window on the top edge of its frame. A window can bedesignated to be in the.Ar foreground ,in which case it will always beon top of all normal, non-foreground windows, and can be coveredonly by other foreground windows. A window need not be completelywithin the edges of the terminal screen. Thus a large window(possibly larger than the screen) may be positioned to show onlya portion of its full size..PpEach window has a cursor and a set of control functions. Most intelligentterminal operations such as line andcharacter deletion and insertion are supported. Display modessuch as underlining and reverse video are available if they aresupported by the terminal. In addition,similar to terminals with multiple pages of memory,each window has a text buffer which can have more lines than the windowitself..Ss Process EnvironmentWith each newly created window, a shell program is spawned with itsprocess environment tailored to that window. Its standard input,output, and diagnostic file descriptors are bound to one end of eithera pseudo-terminal.Xr (pty 4 )or a.Uxdomain socket.Xr (socketpair 4 ) .If a pseudo-terminal is used, then its specialcharacters and modes (see.Xr stty 1 )are copied from the physicalterminal. A.Xr termcap 5entry tailored to this window is createdand passed as environment.Xr (environ 5 )variable.Ev TERMCAP .The termcap entry contains the window's size andcharacteristics as well as information from the physical terminal,such as the existence of underline, reverse video, and other displaymodes, and the codes produced by the terminal's function keys,if any. In addition, the window size attributes of the pseudo-terminalare set to reflect the size of this window, and updated wheneverit is changed by the user. In particular, the editor.Xr vi 1usesthis information to redraw its display..Ss OperationDuring normal execution,.Nm windowcan be in one of two states:conversation mode and command mode. In conversation mode, theterminal's real cursor is placed at the cursor position of a particularwindow--called the current window--and input from the keyboard is sentto the process in that window. The current window is alwayson top of all other windows, except those in foreground. In addition,it is set apart by highlighting its identifier and label in reverse video..PpTyping.Nm window Ns 's escape character (normally.Ic ^P )in conversationmode switches it into command mode. In command mode, the top line ofthe terminal screen becomes the command prompt window, and.Nm windowinterprets input from the keyboard as commands to manipulate windows..PpThere are two types of commands: short commands are usually one or twokey strokes; long commands are strings either typed by the user in thecommand window (see the.Dq Ic \&:command below), or read from a file (see.Ic sourcebelow)..Ss Short CommandsBelow,.Ar \&#represents one of the digits ``1'' to ``9''corresponding to the windows 1 to 9..Ic ^Xmeans.No control\- Ns Ar X , where.Ar Xis any character. In particular,.Ic ^^is.Li control\-^..Ar Escapeis the escape key, or.Ic ^\&[ ..Bl -tag -width Ds.It Ar #Select window.Ar #as the current windowand return to conversation mode..It Ic \&% Ns Ar # Select window.Ar #but stay in command mode..It Ic ^^Select the previous window and return to conversationmode. This is useful for toggling between two windows..It Ic escapeReturn to conversation mode..It Ic ^PReturn to conversation mode and write.Ic ^Pto thecurrent window. Thus, typing two.Ic ^P Ns 'sin conversationmode sends one to the current window. If the.Nm windowescape is changed to some other character, thatcharacter takes the place of.Ic ^Phere..It Ic ?List a short summary of commands..It Ic ^LRefresh the screen..It Ic qExit.Nm window .Confirmation is requested..It Ic ^ZSuspend.Nm window ..It Ic wCreate a new window. The user is prompted for the positionsof the upper left and lower right corners of the window.The cursor is placed on the screen and the keys ``h'', ``j'',``k'', and ``l''move the cursor left, down, up, and right, respectively.The keys ``H'', ``J'', ``K'', and ``L'' move the cursor to the respectivelimits of the screen. Typing a number before the movement keysrepeats the movement that number of times. Return enters the cursor positionas the upper left corner of the window. The lower right corneris entered in the same manner. During this process,the placement of the new window is indicated by a rectangularbox drawn on the screen, corresponding to where the new windowwill be framed. Typing escape at any pointcancels this command..PpThis window becomes the current window,and is given the first available ID. The default buffer sizeis used (see.Ar default_nlinecommand below)..PpOnly fully visible windows can be created this way..It Ic c Ns Ar # Close window.Ar # .The process in the window is sentthe hangup signal (see.Xr kill 1 ) ..Xr Csh 1shouldhandle this signal correctly and cause no problems..It Ic m Ns Ar # Move window.Ar #to another location. A box in the shapeof the window is drawn onthe screen to indicate the new position of the window, and the same keys asthose for the.Ic wcommand are used to position the box. Thewindow can be moved partially off-screen..It Ic M Ns Ar # Move window.Ar #to its previous position..It Ic s Ns Ar # Change the size of window.Ar # .The user is promptedto enter the new lower right corner of the window. A boxis drawn to indicate the new window size. The samekeys used in.Ic wand.Ic mare used to enter the position..It Ic S Ns Ar # Change window.Ar #to its previous size..It Ic ^YScroll the current window up by one line..It Ic ^EScroll the current window down by one line..It Ic ^UScroll the current window up by half the window size..It Ic ^DScroll the current window down by half the window size..It Ic ^BScroll the current window up by the full window size..It Ic ^FScroll the current window down by the full window size..It Ic hMove the cursor of the current window left by one column..It Ic jMove the cursor of the current window down by one line..It Ic kMove the cursor of the current window up by one line..It Ic lMove the cursor of the current window right by one column..It Ic yYank. The user is prompted to enter two points within the currentwindow. Then the content of the current window between those two pointsis saved in the yank buffer..It Ic pPut. The content of the yank buffer is written to the currentwindow as input..It Ic ^SStop output in the current window..It Ic ^QStart output in the current window..It Ic :Enter a line to be executed as long commands.Normal lineediting characters (erase character, erase word, erase line)are supported..El.Ss Long CommandsLong commands are a sequence of statementsparsed much like a programming language, with a syntaxsimilar to that of C. Numeric and string expressions and variablesare supported, as well as conditional statements..PpThere are two data types: string and number. A string is a sequenceof letters or digits beginning with a letter. ``_'' and ``.'' areconsidered letters. Alternately, non-alphanumeric characters canbe included in strings by quoting them in ``"'' or escaping themwith ``\\''. In addition, the ``\\'' sequences of C are supported,both inside and outside quotes (e.g., ``\\n'' is a new line,``\\r'' a carriage return). For example, these are legal strings:abcde01234, "&#$^*&#", ab"$#"cd, ab\\$\\#cd, "/usr/ucb/window"..PpA number is an integer value in one of three forms:a decimal number, an octal number preceded by ``0'',or a hexadecimal number preceded by ``0x'' or ``0X''. The naturalmachine integer size is used (i.e., the signed integer typeof the C compiler). As in C, a non-zero number representsa boolean true..PpThe character ``#'' begins a comment which terminates at theend of the line..PpA statement is either a conditional or an expression. Expressionstatements are terminated with a new line or ``;''. To continuean expression on the next line, terminate the first line with ``\\''..Ss Conditional Statement.Nm Windowhas a single control structure:the fully bracketed if statement in the form.Pp.Bd -literal -offset indent -compactif <expr> then\t<statement>\t...elsif <expr> then\t<statement>\t...else\t<statement>\t...endif.Ed.PpThe.Ic elseand.Ic elsifparts are optional, and the latter canbe repeated any number of times.<Expr>must be numeric..Ss ExpressionsExpressions in.Nm windoware similar to those in theC language, with most C operators supported on numericoperands. In addition, some are overloaded to operate on strings..PpWhen an expression is used as a statement, its value is discardedafter evaluation. Therefore, only expressions with sideeffects (assignments and function calls) are useful as statements..PpSingle valued (no arrays) variables are supported, of bothnumeric and string values. Some variables are predefined. Theyare listed below..PpThe operators in order of increasing precedence:.Bl -tag -width Fl.It Xo.Aq Va expr1.Ic =.Aq Va expr2.XcAssignment. The variable of name.Aq Va expr1 , which must be string valued,is assigned the result of.Aq Va expr2 . Returns the value of.Aq Va expr2 . .It Xo.Aq Va expr1.Ic ?.Aq Va expr2.Ic :.Aq Va expr3.XcReturns the value of.Aq Va expr2 if.Aq Va expr1 evaluates true(non-zero numeric value); returns the value of.Aq Va expr3 otherwise. Onlyone of.Aq Va expr2 and.Aq Va expr3 is evaluated..Aq Va Expr1 mustbe numeric..It Xo.Aq Va expr1.Ic \&|\&|.Aq Va expr2.XcLogical or. Numeric values only. Short circuit evaluation is supported(i.e., if.Aq Va expr1 evaluates true, then.Aq Va expr2 is not evaluated)..It Xo.Aq Va expr1.Ic \&&\&&.Aq Va expr2.XcLogical and with short circuit evaluation. Numeric values only..It Xo.Aq Va expr1.Ic \&|.Aq Va expr2.XcBitwise or. Numeric values only..It Xo.Aq Va expr1.Ic ^.Aq Va expr2.XcBitwise exclusive or. Numeric values only.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -