📄 window.1
字号:
.It Xo.Aq Va expr1.Ic \&&.Aq Va expr2.XcBitwise and. Numeric values only..It Xo.Aq Va expr1.Ic ==.Aq Va expr2 ,.Aq Va expr1.Ic !=.Aq expr2.XcComparison (equal and not equal, respectively). The booleanresult (either 1 or 0) of the comparison is returned. Theoperands can be numeric or string valued. One string operandforces the other to be converted to a string in necessary..It Xo.Aq Va expr1.Ic <.Aq Va expr2 ,.Aq Va expr1.Ic >.Aq Va expr2 ,.Aq Va expr1.Ic <=.Aq Va expr2 ,.XcLess than, greater than, less than or equal to,greater than or equal to. Both numeric and string values, withautomatic conversion as above..It Xo.Aq Va expr1.Ic <<.Aq Va expr2 ,.Aq Va expr1.Ic >>.Aq Va expr2.XcIf both operands are numbers,.Aq Va expr1is bitshifted left (or right) by.Aq Va expr2bits. If.Aq Va expr1isa string, then its first (or last).Aq Va expr2characters arereturns (if.Aq Va expr2is also a string, then its length is usedin place of its value)..It Xo.Aq Va expr1.Ic +.Aq Va expr2 ,.Aq Va expr1.Ic -.Aq Va expr2.XcAddition and subtraction on numbers. For ``+'', if oneargument is a string, then the other is converted to a string,and the result is the concatenation of the two strings..It Xo.Aq Va expr1.Ic \&*.Aq Va expr2 ,.Aq Va expr1.Ic \&/.Aq Va expr2 ,.Aq Va expr1.Ic \&%.Aq Va expr2.XcMultiplication, division, modulo. Numbers only..It Xo.Ic \- Ns Aq Va expr ,.Ic ~ Ns Aq Va expr ,.Ic \&! Ns Aq Va expr ,.Ic \&$ Ns Aq Va expr ,.Ic \&$? Ns Aq Va expr.XcThe first three are unary minus, bitwise complement and logical complementon numbers only. The operator, ``$'', takes.Aq Va exprand returnsthe value of the variable of that name. If.Aq Va expris numericwith value.Ar nand it appears within an alias macro (see below),then it refers to the nth argument of the alias invocation. ``$?''tests for the existence of the variable.Aq Va expr ,and returns 1if it exists or 0 otherwise..It Xo.Ao Va expr Ac Ns Pq Aq Ar arglist.XcFunction call..Aq Va Exprmust be a string that is the uniqueprefix of the name of a builtin.Nm windowfunctionor the full name of a user defined alias macro. In the case of a builtinfunction,.Aq Ar arglistcan be in one of two forms:.Bd -literal -offset indent<expr1>, <expr2>, ...argname1 = <expr1>, argname2 = <expr2>, ....Ed.PpThe two forms can in fact be intermixed, but the result isunpredictable. Most arguments can be omitted; default values willbe supplied for them. The.Ar argnamescan be unique prefixesof the argument names. The commas separatingarguments are used only to disambiguate, and can usually be omitted..PpOnly the first argument form is valid for user defined aliases. Aliasesare defined using the.Ic aliasbuiltin function (see below). Argumentsare accessed via a variant of the variable mechanism (see ``$'' operatorabove)..PpMost functions return value, but some are used for side effectonly and so must be used as statements. When a function or an alias is usedas a statement, the parentheses surroundingthe argument list may be omitted. Aliases return no value..El.Ss Builtin FunctionsThe arguments are listed by name in their naturalorder. Optional arguments are in square brackets.Sq Op .Argumentsthat have no names are in angle brackets.Sq <> .An argument meant to be a boolean flag (often named.Ar flag )can be one of.Ar on ,.Ar off ,.Ar yes ,.Ar no ,.Ar true ,or.Ar false ,withobvious meanings, or it can be a numeric expression,in which case a non-zero value is true..Bl -tag -width Fl.It Xo.Ic alias Ns Po Bq Aq Ar string ,.Bq Aq Ar string\-list Pc.XcIf no argument is given, all currently defined alias macros arelisted. Otherwise,.Aq Ar stringis defined as an alias,with expansion.Aq Ar string\-list > . The previous definition of.Aq Ar string ,if any, is returned. Default for.Aq Ar string\-listis no change..It Ic close Ns Pq Aq Ar window\-listClose the windows specified in.Aq Ar window\-list .If.Aq Ar window\-listis the word.Ar all ,than all windows are closed. No value is returned..It Ic cursormodes Ns Pq Bq Ar modesSet the window cursor to.Ar modes ..Ar Modesis the bitwiseor of the mode bits defined as the variables.Ar m_ul(underline),.Ar m_rev(reverse video),.Ar m_blk(blinking),and.Ar m_grp(graphics, terminal dependent). Returnvalue is the previous modes. Default is no change.For example,.Li cursor($m_rev$m_blk)sets the window cursors to blinkingreverse video..It Ic default_nline Ns Pq Bq Ar nlineSet the default buffer size to.Ar nline .Initially, it is48 lines. Returns the old default buffer size. Default isno change. Using a very large buffer can slow the program downconsiderably..It Ic default_shell Ns Pq Bq Aq Ar string\-listSet the default window shell program to.Aq Ar string\-list .Returnsthe first string in the old shell setting. Default is no change. Initially,the default shell is taken from the environment variable.Ev SHELL ..It Ic default_smooth Ns Pq Bq Ar flagSet the default value of the.Ar smoothargumentto the command.Nm window(see below). The argumentis a boolean flag (one of.Ar on ,.Ar off ,.Ar yes ,.Ar no ,.Ar true ,.Ar false ,or a number,as described above). Default is no change.The old value (as a number) is returned.The initial value is 1 (true)..It Xo.Ic echo Ns ( Op Ar window ,.Bq Aq Ar string\-list ).XcWrite the list of strings,.Aq Ar string-list ,to.Nm window ,separatedby spaces and terminated with a new line. The strings are onlydisplayed in the window, the processes in the window are notinvolved (see.Ic writebelow). No value is returned. Defaultis the current window..It Ic escape Ns Pq Bq Ar escapecSet the escape character to.Ar escape-char .Returns the oldescape character as a one-character string. Default is nochange..Ar Escapeccan be a string of a single character, orin the form.Fl ^X ,meaning.No control\- Ns Ar X ..It Xo.Ic foreground Ns ( Bq Ar window ,.Bq Ar flag ) .XcMove.Nm windowin or out of foreground..Ar Flagis a boolean value. The old foreground flagis returned. Default for.Nm windowis the current window,default for.Ar flagis no change..It Xo.Ic label Ns ( Bq Ar window ,.Bq Ar label ) .XcSet the label of.Nm windowto.Ar label .Returns the oldlabel as a string. Default for.Nm windowis the currentwindow, default for.Ar labelis no change. To turnoff a label, set it to an empty string ("")..It Ic list Ns PqNo arguments. List the identifiers and labels of all windows. Novalue is returned..It Ic select Ns Pq Bq Ar windowMake.Nm windowthe current window. The previous current windowis returned. Default is no change..It Ic source Ns Pq Ar filenameRead and execute the long commands in.Ar filename .Returns \-1 if the file cannot be read, 0 otherwise..It Ic terse Ns Pq Bq flagSet terse mode to.Ar flag .In terse mode, the command windowstays hidden even in command mode, and errors are reported bysounding the terminal's bell..Ar Flagcan take on the samevalues as in.Ar foregroundabove. Returns the old terse flag.Default is no change..It Ic unalias Ns Pq Ar aliasUndefine.Ar alias .Returns -1 if.Ar aliasdoes not exist,0 otherwise..It Ic unset Ns Pq Ar variableUndefine.Ar variable .Returns -1 if.Ar variabledoes not exist,0 otherwise..It Ic variables Ns PqNo arguments. List all variables. No value is returned..It Xo.Ic window Ns ( Bq Ar row ,.Bq Ar column ,.Bq Ar nrow ,.Bq Ar ncol ,.Bq Ar nline ,.Bq Ar label ,.Bq Ar pty , .Bq Ar frame ,.Bq Ar mapnl ,.Bq Ar keepopen ,.Bq Ar smooth ,.Bq Ar shell ) . .XcOpen a window with upper left corner at.Ar row ,.Ar columnand size.Ar nrow ,.Ar ncol .If.Ar nlineis specified,then that many lines are allocated for the text buffer. Otherwise,the default buffer size is used. Default values for.Ar row ,.Ar column ,.Ar nrow ,and.Ar ncolare, respectively,the upper, left-most, lower, or right-most extremes of thescreen..Ar Labelis the label string..Ar Frame ,.Ar pty ,and.Ar mapnlare flag valuesinterpreted in the same way as the argument to.Ar foreground(see above);they mean, respectively, put a frame around this window (default true),allocate pseudo-terminal for this window rather than socketpair (defaulttrue), and map new line characters in this window to carriage returnand line feed (default true if socketpair is used, false otherwise).Normally, a window is automatically closed when its processexits. Setting.Ar keepopento true (default false) prevents thisaction. When.Ar smoothis true, the screen is updated more frequently(for this window) to produce a more terminal-like behavior.The default value of.Ar smoothis set by the.Ar default_smoothcommand (see above)..Ar Shellis a list of strings that will be used as the shellprogram to place in the window (default is the program specifiedby.Ar default_shell ,see above). The created window's identifieris returned as a number..It Xo.Ic write Ns ( Bq Ar window ,.Bq Aq Ar string\-list ).XcSend the list of strings,.Aq Ar string-list ,to.Nm window ,separatedby spaces but not terminated with a new line. The strings are actuallygiven to the window as input. No value is returned. Defaultis the current window..El.Ss Predefined VariablesThese variables are for information only. Redefining them doesnot affect the internal operation of.Nm window ..Bl -tag -width modes.It Ar baudThe baud rate as a number between 50 and 38400..It Ar modesThe display modes (reverse video, underline, blinking, graphics)supported by the physical terminal. The value of.Ar modesis the bitwise or of some of the one bit values,.Ar m_blk ,.Ar m_grp ,.Ar m_rev ,and.Ar m_ul(see below).These values are usefulin setting the window cursors' modes (see.Ar cursormodesabove)..It Ar m_blkThe blinking mode bit..It Ar m_grpThe graphics mode bit (not very useful)..It Ar m_revThe reverse video mode bit..It Ar m_ulThe underline mode bit..It Ar ncolThe number of columns on the physical screen..It Ar nrowThe number of rows on the physical screen..It Ar termThe terminal type. The standard name, found in the second namefield of the terminal's.Ev TERMCAPentry, is used..Sh ENVIRONMENT.Nm Windowutilizes these environment variables:.Ev HOME ,.Ev SHELL ,.Ev TERM ,.Ev TERMCAP ,.Ev WINDOW_ID ..Sh FILES.Bl -tag -width /dev/[pt]ty[pq]? -compact.It Pa ~/.windowrcstartup command file..It Pa /dev/[pt]ty[pq]? pseudo-terminal devices..El.Sh HISTORYThe.Nm windowcommand appeared in.Bx 4.3 ..Sh DIAGNOSTICSShould be self explanatory.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -