summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSadrul Habib Chowdhury <sadrul@users.sourceforge.net>2010-04-01 15:25:03 -0400
committerSadrul Habib Chowdhury <sadrul@users.sourceforge.net>2010-04-01 15:25:03 -0400
commit869278e490913531a98602b8bec5cc08831aa46d (patch)
tree2e3c802ce9ac51e5c7a29389fed2c7b34b64f6dc
parent7ec27de25cc83b2189965584352edb660da00338 (diff)
parenta881bb274ae2d3c4027ae61e1707576bc8d35cab (diff)
downloadscreen-869278e490913531a98602b8bec5cc08831aa46d.tar.gz
Merge branch 'master' into unicode++
-rw-r--r--src/ChangeLog6
-rw-r--r--src/INSTALL3
-rw-r--r--src/ansi.c8
-rw-r--r--src/display.c7
-rw-r--r--src/doc/screen.1154
-rw-r--r--src/doc/screen.texinfo172
-rw-r--r--src/extern.h4
-rw-r--r--src/help.c68
-rw-r--r--src/image.h1
-rw-r--r--src/layer.c10
-rw-r--r--src/list_window.c5
-rw-r--r--src/misc.c4
-rw-r--r--src/process.c466
-rw-r--r--src/resize.c5
-rw-r--r--src/screen.c99
-rw-r--r--src/screen.h8
-rw-r--r--src/socket.c34
-rw-r--r--src/window.c2
-rw-r--r--src/window.h10
19 files changed, 721 insertions, 345 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 9d9d768..720a2f6 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -3,7 +3,7 @@ Version 4.1.0 (??/??/20??):
* 'unbindall' to unbind all commands
* 'up', 'down', 'left', 'right' sub-commands for 'focus'
* 'rendition' to specify rendition to use in caption/hardstatus for
- window-names that have bell/monitor/so turned on.
+ window-names that have bell/monitor/silence/so turned on.
* 'layout', with the following sub-commands
- 'title'
- 'number'
@@ -25,6 +25,8 @@ Version 4.1.0 (??/??/20??):
a mark and the scroll wheel to scroll through the buffer. Additional
features might be to allow clicking on window-titles in the caption to
switch to that window.
+ * All commands prefixed '@' are treated as 'quiet', i.e. '@'-prefixed commands
+ do not trigger any display messages.
Changed Commands:
* '-v' parameter to 'split' command for vertical splits.
@@ -43,6 +45,7 @@ Version 4.1.0 (??/??/20??):
.screenrc:
* $PID expands to the PID of the screen session.
+ * $PWD expands to the current working directory of the session.
* $STY expands to the session name.
* Tilde-expansion in pathnames (e.g. for the 'source' command)
* C-style escapes can be used (e.g. "\n" to get a newline with 'stuff')
@@ -106,6 +109,7 @@ Version 4.1.0 (??/??/20??):
* Emanuele Giaquinta <e.giaquinta@glauco.it>
* Yi-Hsuan Hsin <mhsin@mhsin.org>
* Chris Jones <cjns1989@gmail.com>
+ * Max Kalashnikov <mmt@maxkalashnikov.com>
* Steve Kemp <steve@steve.org.uk>
* Ryan Niebur <ryan@debian.org>
* Jan Christoph Nordholz <hesso@pool.math.tu-berlin.de>
diff --git a/src/INSTALL b/src/INSTALL
index f9750e6..e75b589 100644
--- a/src/INSTALL
+++ b/src/INSTALL
@@ -13,6 +13,9 @@ distributions follows, see the GNU standards document on
prep.ai.mit.edu:pub/gnu/standards.*, especially the `Makefile
Conventions', `Configuration', and `User Interfaces' sections.
+0.) autogen.sh
+--------------
+First, run ./autogen.sh. This will create configure file that you can use.
1.) configure & config.status
-----------------------------
diff --git a/src/ansi.c b/src/ansi.c
index e8178f8..2486e77 100644
--- a/src/ansi.c
+++ b/src/ansi.c
@@ -81,10 +81,10 @@ struct mchar mchar_null;
struct mchar mchar_blank = {' ' /* , 0, 0, ... */};
struct mchar mchar_so = {' ', A_SO /* , 0, 0, ... */};
-int renditions[NUM_RENDS] = {65529 /* =ub */, 65531 /* =b */};
+int renditions[NUM_RENDS] = {65529 /* =ub */, 65531 /* =b */, 65533 /* =u */ };
/* keep string_t and string_t_string in sync! */
-static char *string_t_string[] =
+static char *string_t_string[] =
{
"NONE",
"DCS", /* Device control string */
@@ -943,6 +943,7 @@ register int c;
case '\n':
if (curr->w_autoaka)
FindAKA();
+ case '\013': /* Vertical tab is the same as Line Feed */
LineFeed(0);
return 1;
case '\007':
@@ -1377,6 +1378,9 @@ int c, intermediate;
break;
case 3: /* COLM: column mode */
i = (i ? Z0width : Z1width);
+ ClearScreen();
+ curr->w_x = 0;
+ curr->w_y = 0;
WChangeSize(curr, i, curr->w_height);
cols = curr->w_width;
rows = curr->w_height;
diff --git a/src/display.c b/src/display.c
index 4bdc887..dd6500e 100644
--- a/src/display.c
+++ b/src/display.c
@@ -2405,6 +2405,13 @@ int y, from, to, isblank;
yy = y - lvp->v_yoff;
xx = to < lvp->v_xe ? to : lvp->v_xe;
+ if (lcv->c_layer && lcv->c_xoff + lcv->c_layer->l_width == from)
+ {
+ GotoPos(from, y);
+ SetRendition(&mchar_blank);
+ PUTCHARLP('|');
+ from++;
+ }
if (lcv->c_layer && yy == lcv->c_layer->l_height)
{
GotoPos(from, y);
diff --git a/src/doc/screen.1 b/src/doc/screen.1
index 25ab360..ff2fe82 100644
--- a/src/doc/screen.1
+++ b/src/doc/screen.1
@@ -1274,28 +1274,45 @@ window and its history into the paste buffer. In this mode a vi-like
.br
.in +4n
.ti -2n
-\fBh\fP, \fBj\fP, \fBk\fP, \fBl\fP move the cursor line by line or
-column by column.
+\fBh\fP, \fBC-h\fP, or \fBleft arrow\fP move the cursor left.
.br
.ti -2n
-\fB0\fP, \fB^\fP and \fB$\fP move to the leftmost column, to the first or last
-non-whitespace character on the line.
+\fBj\fP, \fBC-n\fP, or \fBdown arrow\fP move the cursor down.
+.br
+.ti -2n
+\fBk\fP, \fBC-p\fP, or \fBup arrow\fP move the cursor up.
+.br
+.ti -2n
+\fBl\fP ('el') or \fBright arrow\fP move the cursor right.
+.br
+.ti -2n
+\fB0\fP (zero) or \fBC-a\fP move to the leftmost column.
+.br
+.ti -2n
+\fB+\fP and \fB\-\fP positions one line up and down.
.br
.ti -2n
\fBH\fP, \fBM\fP and \fBL\fP move the cursor to the leftmost column
of the top, center or bottom line of the window.
.br
.ti -2n
-\fB+\fP and \fB\-\fP positions one line up and down.
+\fB|\fP moves to the specified absolute column.
+.br
+.ti -2n
+\fBg\fP or \fBhome\fP moves to the beginning of the buffer.
.br
.ti -2n
-\fBG\fP moves to the specified absolute line (default: end of buffer).
+\fBG\fP or \fBend\fP moves to the specified absolute line (default: end of buffer).
.br
.ti -2n
-\fB|\fP moves to the specified absolute column.
+\fB%\fP jumps to the specified percentage of the buffer.
.br
.ti -2n
-\fBw\fP, \fBb\fP, \fBe\fP move the cursor word by word.
+\fB^\fP or \fB$\fP move to the leftmost column, to the first or last
+non-whitespace character on the line.
+.br
+.ti -2n
+\fBw\fP, \fBb\fP, and \fBe\fP move the cursor word by word.
.br
.ti -2n
\fBB\fP, \fBE\fP move the cursor WORD by WORD (as in vi).
@@ -1306,7 +1323,11 @@ of the top, center or bottom line of the window.
move the cursor to the 3rd 'y' to the right.)
.br
.ti -2n
-\fB;\fP \fB,\fP Repeat the last f/F/t/T command in the same/opposite direction.
+\fB;\fP and \fB,\fP Repeat the last f/F/t/T command in the same/opposite direction.
+.br
+.ti -2n
+\fBC-e\fP and \fBC-y\fP scroll the display up/down by one line
+while preserving the cursor position.
.br
.ti -2n
\fBC-u\fP and \fBC-d\fP scroll the display up/down by the specified amount of
@@ -1315,12 +1336,6 @@ lines while preserving the cursor position. (Default: half screen-full).
.ti -2n
\fBC-b\fP and \fBC-f\fP scroll the display up/down a full screen.
.br
-.ti -2n
-\fBg\fP moves to the beginning of the buffer.
-.br
-.ti -2n
-\fB%\fP jumps to the specified percentage of the buffer.
-.br
.ti -4n
.IR Note :
@@ -1334,11 +1349,12 @@ emacs-style keymap, as this involves multi-character codes.
.IR Marking :
.br
The copy range is specified by setting two marks. The text between these marks
-will be highlighted. Press
+will be highlighted. Press:
.br
.ti -2n
-\fBspace\fP to set the first or second mark
-respectively.
+\fBspace\fP or \fBenter\fP to set the first or second mark
+respectively. If \fBmousetrack\fP is set to `on', marks can also be set using
+\fPleft mouse click\fP.
.br
.ti -2n
\fBY\fP and \fBy\fP used to mark one whole line or to mark from
@@ -1370,6 +1386,10 @@ Example: \*QC-a C-[ H 10 j 5 Y\*U will copy lines
\fBC-a s\fP \fIEmacs\fP style incremental search forward.
.ti -2n
\fBC-r\fP \fIEmacs\fP style reverse i-search.
+.ti -2n
+\fBn\fP Find next search pattern.
+.ti -2n
+\fBN\fP Find previous search pattern.
.ti -4n
.IR Specials :
.br
@@ -1378,7 +1398,7 @@ There are however some keys that act differently than in
.I Vi
does not allow one to yank rectangular blocks of text, but
.I screen
-does. Press
+does. Press:
.br
.ti -2n
\fBc\fP or \fBC\fP to set the left or right margin respectively. If no repeat count is
@@ -1403,7 +1423,7 @@ whitespace and comma separated lines. Note that you can prepend the newline
character with a carriage return character, by issuing a \*Qcrlf on\*U.
.br
.ti -2n
-\fBv\fP is for all the
+\fBv\fP or \fBV\fP is for all the
.I vi
users with \*Q:set numbers\*U \- it toggles the left margin between column 9
and 1. Press
@@ -1427,10 +1447,13 @@ to that file: \*QC-A [ g SPACE G $ >\*U.
\fBC-g\fP gives information about the current line and column.
.br
.ti -2n
-\fBx\fP exchanges the first mark and the current cursor position. You
+\fBx\fP or \fBo\fP exchanges the first mark and the current cursor position. You
can use this to adjust an already placed mark.
.br
.ti -2n
+\fBC-l\fP ('el') will redraw the screen.
+.br
+.ti -2n
\fB@\fP does nothing. Does not even exit copy mode.
.br
.ti -2n
@@ -2801,13 +2824,13 @@ Unlinks the screen-exchange file used by the commands \*Qwritebuf\*U and
\*Qreadbuf\*U.
.sp
.ne 3
-.B "rendition bell" | monitor | so
+.B "rendition bell" | monitor | silence | so
.RB "\fIattr\fR " [ \fIcolor ]
.PP
Change the way
.I screen
renders the titles of windows that have monitor or bell flags set in caption or hardstatus or windowlist. See the \*QSTRING ESCAPES\*U chapter for the syntax of the modifiers.
-The default for monitor is currently \*Q=b \*U (bold, active colors) and for bell \*Q=ub \*U (underline, bold and active colors).
+The default for monitor is currently \*Q=b \*U (bold, active colors), for bell \*Q=ub \*U (underline, bold and active colors), and \*Q=u \*U for silence.
.sp
.ne 3
.B "reset"
@@ -3305,9 +3328,7 @@ vice versa.
.B title
.RI [ title ]
.PP
-Display all windows in a table for visual window selection. The
-desired window can be selected via the standard movement keys (see
-the \*Qcopy\*U command) and activated via the return key.
+Display all windows in a table for visual window selection.
If screen was in a window group, screen will
back out of the group and then display the windows in that group.
If the
@@ -3323,6 +3344,69 @@ The
option will show the windows inside any groups in that level
and downwards.
+The following keys are used to navigate in \*Qwindowlist\*U:
+.br
+.in +4n
+.ti -2n
+\fBk\fP, \fBC-p\fP, or \fBup\fP Move up one line.
+.br
+.ti -2n
+\fBj\fP, \fBC-n\fP, or \fBdown\fP Move down one line.
+.br
+.ti -2n
+\fBC-g\fP or \fBescape\fP Exit windowlist.
+.br
+.ti -2n
+\fBC-a\fP or \fBhome\fP Move to the first line.
+.br
+.ti -2n
+\fBC-e\fP or \fBend\fP Move to the last line.
+.br
+.ti -2n
+\fBC-u\fP or \fBC-d\fP Move one half page up or down.
+.br
+.ti -2n
+\fBC-b\fP or \fBC-f\fP Move one full page up or down.
+.br
+.ti -2n
+\fBmouseclick\fP Move to the selected line. Available when
+\*Qmousetrack\*U is set to \*Qon\*U
+.br
+.ti -2n
+\fB/\fP Search.
+.br
+.ti -2n
+\fBn\fP Repeat search in the forward direction.
+.br
+.ti -2n
+\fBN\fP Repeat search in the backward direction.
+.br
+.ti -2n
+\fBm\fP Toggle MRU.
+.br
+.ti -2n
+\fBg\fP Toggle group nesting.
+.br
+.ti -2n
+\fBa\fP All window view.
+.br
+.ti -2n
+\fBC-h\fP or backspace Back out the group.
+.br
+.ti -2n
+\fB,\fP Switch numbers with the previous window.
+.br
+.ti -2n
+\fB.\fP Switch numbers with the next window.
+.br
+.ti -2n
+\fBK\fP Kill that window.
+.br
+.ti -2n
+\fBspace\fP or \fBenter\fP Select that window.
+.br
+.in -4n
+
The table format can be changed with the \fBstring\fP and
\fBtitle\fP option, the title is displayed as table heading, while
the lines are made by using the string setting. The default
@@ -3330,6 +3414,9 @@ setting is \*QNum Name%=Flags\*U for the title and \*Q%3n %t%=%f\*U
for the lines.
See the \*QSTRING ESCAPES\*U chapter for more codes (e.g. color
settings).
+
+\*QWindowlist\*U needs a region size of at least 10 characters wide
+and 6 characters high in order to display.
.sp
.ne 3
.B windows
@@ -3503,7 +3590,7 @@ Usually 300, 1200, 9600 or 19200. This affects transmission as well as receive s
Specify the transmission of eight (or seven) bits per byte.
.IP "ixon or -ixon"
Enables (or disables) software flow-control (CTRL-S/CTRL-Q) for sending data.
-.IP "ixoff or -ixon"
+.IP "ixoff or -ixoff"
Enables (or disables) software flow-control for receiving data.
.IP "istrip or -istrip"
Clear (or keep) the eight bit in each received byte.
@@ -4789,10 +4876,19 @@ termcap(5), utmp(5), vi(1), captoinfo(1), tic(1)
.SH AUTHORS
Originally created by Oliver Laumann, this latest version was
-produced by Wayne Davison, Juergen Weigert and Michael Schroeder.
+produced by Juergen Weigert, Michael Schroeder, Micah Cowan and
+Sadrul Habib Chowdhury.
.SH COPYLEFT
.nf
+Copyright (c) 2010
+ Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de)
+ Sadrul Habib Chowdhury (sadrul@users.sourceforge.net)
+Copyright (c) 2008, 2009
+ Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de)
+ Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de)
+ Micah Cowan (micah@cowan.name)
+ Sadrul Habib Chowdhury (sadrul@users.sourceforge.net)
Copyright (C) 1993-2003
Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de)
Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de)
@@ -4801,7 +4897,7 @@ Copyright (C) 1987 Oliver Laumann
.PP
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
+the Free Software Foundation; either version 3, or (at your option)
any later version.
.PP
This program is distributed in the hope that it will be useful,
diff --git a/src/doc/screen.texinfo b/src/doc/screen.texinfo
index eb834e4..539f23d 100644
--- a/src/doc/screen.texinfo
+++ b/src/doc/screen.texinfo
@@ -1142,7 +1142,7 @@ Store a string to a register. @xref{Registers}.
Kill current region. @xref{Regions}.
@item removebuf
Delete the screen-exchange file. @xref{Screen Exchange}.
-@item rendition bell | monitor | so @var{attr} [@var{color}]
+@item rendition bell | monitor | silence | so @var{attr} [@var{color}]
Change text attributes in caption for flagged windows. @xref{Rendition}.
@item reset
Reset the terminal settings for the window. @xref{Reset}.
@@ -1577,9 +1577,7 @@ current window. The latter is useful if used with screen's
@deffnx Command windowlist title [@var{title}]
(@kbd{C-a "})@*
Display all windows in a table for visual window selection.
-The desired window can be selected via the standard
-movement keys (@pxref{Movement}) and activated via
-the return key. If screen was in a window group, screen will
+If screen was in a window group, screen will
back out of the group and then display the windows in that
group. If the @code{-b} option is given, screen will
switch to the blank window before presenting the list, so
@@ -1589,6 +1587,66 @@ sorting by window numbers screen uses its internal most-recently-used
list. The @code{-g} option will show the windows inside any groups
in that level and downwards.
+The following keys are used to navigate in @code{windowlist}:
+
+@noindent
+@kbd{k}, @kbd{C-p}, or @kbd{up} Move up one line.
+
+@noindent
+@kbd{j}, @kbd{C-n}, or @kbd{down} Move down one line.
+
+@noindent
+@kbd{C-g} or @kbd{escape} Exit windowlist.
+
+@noindent
+@kbd{C-a} or @kbd{home} Move to the first line.
+
+@noindent
+@kbd{C-e} or @kbd{end} Move to the last line.
+
+@noindent
+@kbd{C-u} or @kbd{C-d} Move one half page up or down.
+
+@noindent
+@kbd{C-b} or @kbd{C-f} Move one full page up or down.
+
+@noindent
+@kbd{mouseclick} Move to the selected line. Available when
+@code{mousetrack} is set to @code{on}.
+
+@noindent
+@kbd{/} Search.
+
+@noindent
+@kbd{n} Repeat search in the forward direction.
+
+@noindent
+@kbd{N} Repeat search in the backward direction.
+
+@noindent
+@kbd{m} Toggle MRU.
+
+@noindent
+@kbd{g} Toggle group nesting.
+
+@noindent
+@kbd{a} All window view.
+
+@noindent
+@kbd{C-h} or @kbd{backspace} Back out the group.
+
+@noindent
+@kbd{,} Switch numbers with the previous window.
+
+@noindent
+@kbd{.} Switch numbers with the next window.
+
+@noindent
+@kbd{K} Kill that window.
+
+@noindent
+@kbd{space} or @kbd{enter} Select that window.
+
The table format can be changed with the string and title
option, the title is displayed as table heading, while the
lines are made by using the string setting. The default
@@ -1596,6 +1654,8 @@ setting is @samp{Num Name%=Flags} for the title and
@samp{%3n %t%=%f} for the lines. See the string escapes chapter
(@pxref{String Escapes}) for more codes (e.g. color settings).
+@code{Windowlist} needs a region size of at least 10 characters
+wide and 6 characters high in order to display.
@end deffn
@node Session Management, Regions, Selecting, Top
@@ -3479,46 +3539,69 @@ in a single statement.
@subsection Movement Keys
@noindent
-@kbd{h}, @kbd{j}, @kbd{k}, @kbd{l} move the cursor line by line or
-column by column.
+@kbd{h}, @kbd{C-h}, or @kbd{left arrow} move the cursor left.
@noindent
-@kbd{0}, @kbd{^} and @kbd{$} move to the leftmost column or to the first
-or last non-whitespace character on the line.
+@kbd{j}, @kbd{C-n}, or @kbd{down arrow} move the cursor down.
@noindent
-@kbd{H}, @kbd{M} and @kbd{L} move the cursor to the leftmost column
-of the top, center or bottom line of the window.
+@kbd{k}, @kbd{C-p}, or @kbd{up arrow} move the cursor up.
+
+@noindent
+@kbd{l} ('el'), or @kbd{right arrow} move the cursor right.
+
+@noindent
+@kbd{0} (zero) or @kbd{C-a} move to the leftmost column.
@noindent
@kbd{+} and @kbd{-} move the cursor to the leftmost column of the next
or previous line.
@noindent
-@kbd{G} moves to the specified absolute line (default: end of buffer).
-
+@kbd{H}, @kbd{M} and @kbd{L} move the cursor to the leftmost column
+of the top, center or bottom line of the window.
+
@noindent
@kbd{|} moves to the specified absolute column.
@noindent
-@kbd{w}, @kbd{b}, @kbd{e} move the cursor word by word.
+@kbd{g} or @kbd{home} moves to the beginning of the buffer.
+
+@noindent
+@kbd{G} or @kbd{end} moves to the specified absolute line (default: end of buffer).
+
+@noindent
+@kbd{%} jumps to the specified percentage of the buffer.
+
+@noindent
+@kbd{^} or @kbd{$} move to the first
+or last non-whitespace character on the line.
+
+@noindent
+@kbd{w}, @kbd{b}, and @kbd{e} move the cursor word by word.
@noindent
@kbd{B}, @kbd{E} move the cursor WORD by WORD (as in vi).
@noindent
-@kbd{C-u} and @kbd{C-d} scroll the display up/down by the specified
-amount of lines while preserving the cursor position. (Default: half
-screenful).
+@kbd{f}/@kbd{F}, @kbd{t}/@kbd{T} move the cursor forward/backward to the
+next occurence of the target. (eg, '3fy' will move the cursor to the 3rd
+'y' to the right.)
@noindent
-@kbd{C-b} and @kbd{C-f} move the cursor up/down a full screen.
+@kbd{;} and @kbd{,} Repeat the last f/F/t/T command in the same/opposite direction.
+
+@noindent
+@kbd{C-e} and @kbd{C-y} scroll the display up/down by one line
+while preserving the cursor position.
@noindent
-@kbd{g} moves to the beginning of the buffer.
+@kbd{C-u} and @kbd{C-d} scroll the display up/down by the specified
+amount of lines while preserving the cursor position. (Default: half
+screenful).
@noindent
-@kbd{%} jumps to the specified percentage of the buffer.
+@kbd{C-b} and @kbd{C-f} move the cursor up/down a full screen.
Note that Emacs-style movement keys can be specified by a .screenrc
command. (@code{markkeys "h=^B:l=^F:$=^E"}) There is no simple method for
@@ -3528,8 +3611,12 @@ a full emacs-style keymap, however, as this involves multi-character codes.
@subsection Marking
The copy range is specified by setting two marks. The text between these
-marks will be highlighted. Press @kbd{space} to set the first or second
-mark respectively.
+marks will be highlighted. Press:
+
+@noindent
+@kbd{space} or @kbd{enter} to set the first or second mark respectively.
+If @code{mousetrack} is set to @code{on}, marks can also be set using
+@kbd{left mouse click}.
@noindent
@kbd{Y} and @kbd{y} can be used to mark one whole line or to mark from
@@ -3543,7 +3630,11 @@ start of line.
Any command in copy mode can be prefixed with a number (by pressing
digits @kbd{0@dots{}9}) which is taken as a repeat count. Example:
-@kbd{C-a C-[ H 10 j 5 Y} will copy lines 11 to 15 into the paste buffer.
+@example
+@kbd{C-a C-[ H 10 j 5 Y}
+@end example
+@noindent
+will copy lines 11 to 15 into the paste buffer.
@node Searching, Specials, Repeat count, Copy
@subsection Searching
@@ -3566,25 +3657,35 @@ Tell screen to ignore the case of characters in searches. Default is
@code{off}.
@end deffn
+@noindent
+@kbd{n} Repeat search in forward direction.
+
+@noindent
+@kbd{N} Repeat search in backward direction.
+
@node Specials, , Searching, Copy
@subsection Specials
There are, however, some keys that act differently here from in
@code{vi}. @code{Vi} does not allow to yank rectangular blocks of text,
-but @code{screen} does. Press
+but @code{screen} does. Press:
@noindent
@kbd{c} or @kbd{C} to set the left or right margin respectively. If no
repeat count is given, both default to the current cursor position.@*
Example: Try this on a rather full text screen:
+@example
@kbd{C-a [ M 20 l SPACE c 10 l 5 j C SPACE}.
+@end example
@noindent
This moves one to the middle line of the screen, moves in 20 columns left,
marks the beginning of the paste buffer, sets the left column, moves 5 columns
down, sets the right column, and then marks the end of
-the paste buffer. Now try:@*
+the paste buffer. Now try:
+@example
@kbd{C-a [ M 20 l SPACE 10 l 5 j SPACE}
+@end example
@noindent
and notice the difference in the amount of text copied.
@@ -3597,11 +3698,11 @@ character with a carriage return character, by issuing a @code{set crlf
on}.
@noindent
-@kbd{v} is for all the @code{vi} users who use @code{:set numbers} - it
+@kbd{v} or @kbd{V} is for all the @code{vi} users who use @code{:set numbers} - it
toggles the left margin between column 9 and 1.
@noindent
-@kbd{a} before the final space key turns on append mode. Thus
+@kbd{a} before the final @kbd{space} key turns on append mode. Thus
the contents of the paste buffer will not be overwritten, but appended to.
@noindent
@@ -3612,16 +3713,22 @@ the contents of the paste buffer will not be overwritten, but appended to.
to the screen-exchange file (@file{/tmp/screen-exchange} per default)
once copy-mode is finished. @xref{Screen Exchange}.@*
This example demonstrates how to dump the
-whole scrollback buffer to that file: @*@kbd{C-a [ g SPACE G $ >}.
+whole scrollback buffer to that file:
+@example
+@kbd{C-a [ g SPACE G $ >}.
+@end example
@noindent
@kbd{C-g} gives information about the current line and column.
@noindent
-@kbd{x} exchanges the first mark and the current cursor position. You
+@kbd{x} or @kbd{o} ('oh') exchanges the first mark and the current cursor position. You
can use this to adjust an already placed mark.
@noindent
+@kbd{C-l} ('el') will redraw the screen.
+
+@noindent
@kbd{@@} does nothing. Absolutely nothing. Does not even exit copy
mode.
@@ -5145,15 +5252,15 @@ access to your terminal, they will be able to fire off print commands.
@node Rendition, Sorendition, Printcmd, Miscellaneous
@section Rendition
-@deffn Command rendition bell | monitor | so @var{attr} [@var{color}]
+@deffn Command rendition bell | monitor | silence | so @var{attr} [@var{color}]
(none)@*
Change the way screen renders the titles of windows that have monitor
or bell flags set in caption or hardstatus or windowlist.
See the chapter
about string escapes (@pxref{String Escapes}) for the syntax of
the modifiers. The default for monitor is currently @samp{=b} (bold,
-active colors), and for bell is @samp{=ub} (underline, bold and
-active colors).
+active colors), for bell @samp{=ub} (underline, bold and active colors), and
+for silence @samp{=u}.
@end deffn
@node Sorendition, Attrcolor, Rendition, Miscellaneous
@@ -5604,7 +5711,8 @@ Authors @*
=======
Originally created by Oliver Laumann, this latest version was
-produced by Wayne Davison, Juergen Weigert and Michael Schroeder.
+produced by Juergen Weigert, Michael Schroeder, Micah Cowan and
+Sadrul Habib Chowdhury.
@noindent
Contributors @*
diff --git a/src/extern.h b/src/extern.h
index ee655f5..2b9722e 100644
--- a/src/extern.h
+++ b/src/extern.h
@@ -42,9 +42,13 @@ extern void Kill __P((int, int));
#ifdef USEVARARGS
extern void Msg __P((int, const char *, ...)) __attribute__((format(printf, 2, 3)));
extern void Panic __P((int, const char *, ...)) __attribute__((format(printf, 2, 3))) __attribute__((__noreturn__));
+extern void QueryMsg __P((int, const char *, ...)) __attribute__((format(printf, 2, 3)));
+extern void Dummy __P((int, const char *, ...)) __attribute__((format(printf, 2, 3)));
#else
extern void Msg __P(());
extern void Panic __P(());
+extern void QueryMsg __P(());
+extern void Dummy __P(());
#endif
extern void Finit __P((int));
extern void MakeNewEnv __P((void));
diff --git a/src/help.c b/src/help.c
index a624941..8726b1b 100644
--- a/src/help.c
+++ b/src/help.c
@@ -534,8 +534,74 @@ http://www.gnu.org/licenses/, or contact Free Software Foundation, Inc., \
51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA.\n\
\n\
Send bugreports, fixes, enhancements, t-shirts, money, beer & pizza to \
-screen@uni-erlangen.de\n";
+screen-devel@gnu.org\n\n\n"
+"Capabilities:\n"
+
+#ifdef COPY_PASTE
+"+copy "
+#else
+"-copy "
+#endif
+
+#ifdef REMOTE_DETACH
+"+remote-detach "
+#else
+"-remote-detach "
+#endif
+
+#ifdef POW_DETACH
+"+power-detach "
+#else
+"-power-detach "
+#endif
+
+#ifdef MULTI
+"+multi-attach "
+#else
+"-multi-attach "
+#endif
+
+#ifdef MULTIUSER
+"+multi-user "
+#else
+"-multi-user "
+#endif
+
+#ifdef FONT
+"+font "
+#else
+"-font "
+#endif
+
+#ifdef COLORS256
+"+color-256 "
+#elif defined(COLORS16)
+"+color-16 "
+#elif defined(COLOR)
+"+color "
+#else
+"-color "
+#endif
+
+#ifdef UTF8
+"+utf8 "
+#else
+"-utf8 "
+#endif
+
+#ifdef RXVT_OSC
+"+rxvt "
+#else
+"-rxvt "
+#endif
+
+#ifdef BUILTIN_TELNET
+"+builtin-telnet "
+#else
+"-builtin-telnet "
+#endif
+;
static void
CopyrightProcess(ppbuf, plen)
diff --git a/src/image.h b/src/image.h
index f7871b7..a06c95b 100644
--- a/src/image.h
+++ b/src/image.h
@@ -171,6 +171,7 @@ enum
{
REND_BELL = 0,
REND_MONITOR,
+ REND_SILENCE,
NUM_RENDS
};
diff --git a/src/layer.c b/src/layer.c
index 930ebf0..fd00063 100644
--- a/src/layer.c
+++ b/src/layer.c
@@ -594,6 +594,16 @@ int uself;
xe2 = vp->v_xe;
display = cv->c_display;
ClearArea(xs2, ys2, vp->v_xs, vp->v_xe, xe2, ye2, bce, uself);
+ if (xe == l->l_width - 1 && xe2 > vp->v_xoff + xe)
+ {
+ int y;
+ SetRendition(&mchar_blank);
+ for (y = ys2; y <= ye2; y++)
+ {
+ GotoPos(xe + vp->v_xoff + 1, y);
+ PUTCHARLP('|');
+ }
+ }
#endif
}
}
diff --git a/src/list_window.c b/src/list_window.c
index ee71fde..b65600d 100644
--- a/src/list_window.c
+++ b/src/list_window.c
@@ -266,6 +266,11 @@ gl_Window_row(struct ListData *ldata, struct ListRow *lrow)
mchar = &mchar_rend;
ApplyAttrColor(renditions[REND_BELL], mchar);
}
+ else if ((w->w_silence == SILENCE_FOUND || w->w_silence == SILENCE_DONE) && renditions[REND_SILENCE] != -1)
+ {
+ mchar = &mchar_rend;
+ ApplyAttrColor(renditions[REND_SILENCE], mchar);
+ }
else
mchar = &mchar_blank;
diff --git a/src/misc.c b/src/misc.c
index ff3bebb..43e93a2 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -609,7 +609,7 @@ char *value;
* the string space, we can free our buf now.
*/
free(buf);
-# else /* NEEDSETENV */
+# else /* NEEDPUTENV */
/*
* For all sysv-ish systems that link a standard putenv()
* the string-space buf is added to the environment and must not
@@ -617,7 +617,7 @@ char *value;
* We are sorry to say that memory is lost here, when setting
* the same variable again and again.
*/
-# endif /* NEEDSETENV */
+# endif /* NEEDPUTENV */
#else /* USESETENV */
# if HAVE_SETENV_3
setenv(var, value, 1);
diff --git a/src/process.c b/src/process.c
index d685501..cc2b56f 100644
--- a/src/process.c
+++ b/src/process.c
@@ -1129,6 +1129,16 @@ char *data;
LayProcess(&buf, &len);
}
+/* If the command is not 'quieted', then use Msg to output the message. If it's a remote
+ * query, then Msg takes care of also outputting the message to the querying client.
+ *
+ * If we want the command to be quiet, and it's a remote query, then use QueryMsg so that
+ * the response does go back to the querying client.
+ *
+ * If the command is quieted, and it's not a remote query, then just don't print the message.
+ */
+#define OutputMsg (!act->quiet ? Msg : queryflag >= 0 ? QueryMsg : Dummy)
+
/*ARGSUSED*/
void
DoAction(act, key)
@@ -1161,25 +1171,25 @@ int key;
if (!(n & CAN_QUERY) && queryflag >= 0)
{
/* Query flag is set, but this command cannot be queried. */
- Msg(0, "%s command cannot be queried.", comms[nr].name);
+ OutputMsg(0, "%s command cannot be queried.", comms[nr].name);
queryflag = -1;
return;
}
if ((n & NEED_DISPLAY) && display == 0)
{
- Msg(0, "%s: %s: display required", rc_name, comms[nr].name);
+ OutputMsg(0, "%s: %s: display required", rc_name, comms[nr].name);
queryflag = -1;
return;
}
if ((n & NEED_FORE) && fore == 0)
{
- Msg(0, "%s: %s: window required", rc_name, comms[nr].name);
+ OutputMsg(0, "%s: %s: window required", rc_name, comms[nr].name);
queryflag = -1;
return;
}
if ((n & NEED_LAYER) && flayer == 0)
{
- Msg(0, "%s: %s: display or window required", rc_name, comms[nr].name);
+ OutputMsg(0, "%s: %s: display or window required", rc_name, comms[nr].name);
queryflag = -1;
return;
}
@@ -1190,7 +1200,7 @@ int key;
{
if (AclCheckPermCmd(D_user, ACL_EXEC, &comms[nr]))
{
- Msg(0, "%s: %s: permission denied (user %s)",
+ OutputMsg(0, "%s: %s: permission denied (user %s)",
rc_name, comms[nr].name, (EffectiveAclUser ? EffectiveAclUser : D_user)->u_name);
queryflag = -1;
return;
@@ -1213,7 +1223,7 @@ int key;
{
if (!fore)
{
- Msg(0, "select . needs a window");
+ OutputMsg(0, "select . needs a window");
queryflag = -1;
}
else
@@ -1230,18 +1240,18 @@ int key;
#ifdef AUTO_NUKE
case RC_DEFAUTONUKE:
if (ParseOnOff(act, &defautonuke) == 0 && msgok)
- Msg(0, "Default autonuke turned %s", defautonuke ? "on" : "off");
+ OutputMsg(0, "Default autonuke turned %s", defautonuke ? "on" : "off");
if (display && *rc_name)
D_auto_nuke = defautonuke;
break;
case RC_AUTONUKE:
if (ParseOnOff(act, &D_auto_nuke) == 0 && msgok)
- Msg(0, "Autonuke turned %s", D_auto_nuke ? "on" : "off");
+ OutputMsg(0, "Autonuke turned %s", D_auto_nuke ? "on" : "off");
break;
#endif
case RC_DEFOBUFLIMIT:
if (ParseNum(act, &defobuflimit) == 0 && msgok)
- Msg(0, "Default limit set to %d", defobuflimit);
+ OutputMsg(0, "Default limit set to %d", defobuflimit);
if (display && *rc_name)
{
D_obufmax = defobuflimit;
@@ -1250,9 +1260,9 @@ int key;
break;
case RC_OBUFLIMIT:
if (*args == 0)
- Msg(0, "Limit is %d, current buffer size is %d", D_obufmax, D_obuflen);
+ OutputMsg(0, "Limit is %d, current buffer size is %d", D_obufmax, D_obuflen);
else if (ParseNum(act, &D_obufmax) == 0 && msgok)
- Msg(0, "Limit set to %d", D_obufmax);
+ OutputMsg(0, "Limit set to %d", D_obufmax);
D_obuflenmax = D_obuflen - D_obufmax;
break;
case RC_DUMPTERMCAP:
@@ -1270,11 +1280,11 @@ int key;
}
if (*args && args[1])
{
- Msg(0, "%s: hardcopy: too many arguments", rc_name);
+ OutputMsg(0, "%s: hardcopy: too many arguments", rc_name);
break;
}
if (fore == 0 && *args == 0)
- Msg(0, "%s: hardcopy: window required", rc_name);
+ OutputMsg(0, "%s: hardcopy: window required", rc_name);
else
WriteFile(user, *args, mode);
}
@@ -1318,13 +1328,13 @@ int key;
if (fore->w_pwin)
{
FreePseudowin(fore);
- Msg(0, "Filter removed.");
+ OutputMsg(0, "Filter removed.");
break;
}
#endif
name = SaveStr(fore->w_title);
KillWindow(fore);
- Msg(0, "Window %d (%s) killed.", n, name);
+ OutputMsg(0, "Window %d (%s) killed.", n, name);
if (name)
free(name);
break;
@@ -1363,9 +1373,9 @@ int key;
if (!*args)
{
if (dfp)
- Msg(0, "debugging info is written to %s/", DEBUGDIR);
+ OutputMsg(0, "debugging info is written to %s/", DEBUGDIR);
else
- Msg(0, "debugging is currently off. Use 'debug on' to enable.");
+ OutputMsg(0, "debugging is currently off. Use 'debug on' to enable.");
break;
}
if (dfp)
@@ -1383,7 +1393,7 @@ int key;
# endif /* SIG_NODEBUG */
#else
if (*args == 0 || strcmp("off", *args))
- Msg(0, "Sorry, screen was compiled without -DDEBUG option.");
+ OutputMsg(0, "Sorry, screen was compiled without -DDEBUG option.");
#endif
break;
#ifdef ZMODEM
@@ -1396,7 +1406,7 @@ int key;
zmodem_sendcmd = SaveStr(args[1]);
}
if (msgok)
- Msg(0, "zmodem sendcmd: %s", zmodem_sendcmd);
+ OutputMsg(0, "zmodem sendcmd: %s", zmodem_sendcmd);
break;
}
if (*args && !strcmp(*args, "recvcmd"))
@@ -1407,7 +1417,7 @@ int key;
zmodem_recvcmd = SaveStr(args[1]);
}
if (msgok)
- Msg(0, "zmodem recvcmd: %s", zmodem_recvcmd);
+ OutputMsg(0, "zmodem recvcmd: %s", zmodem_recvcmd);
break;
}
if (*args)
@@ -1419,13 +1429,13 @@ int key;
i = 1;
if (i == 4)
{
- Msg(0, "usage: zmodem off|auto|catch|pass");
+ OutputMsg(0, "usage: zmodem off|auto|catch|pass");
break;
}
zmodem_mode = i;
}
if (msgok)
- Msg(0, "zmodem mode is %s", zmodes[zmodem_mode]);
+ OutputMsg(0, "zmodem mode is %s", zmodes[zmodem_mode]);
break;
#endif
case RC_UNBINDALL:
@@ -1434,7 +1444,7 @@ int key;
for (i = 0; i < sizeof(ktab)/sizeof(*ktab); i++)
ClearAction(&ktab[i]);
- Msg(0, "Unbound all keys." );
+ OutputMsg(0, "Unbound all keys." );
break;
}
case RC_ZOMBIE:
@@ -1446,7 +1456,7 @@ int key;
}
if (*argl == 0 || *argl > 2)
{
- Msg(0, "%s:zombie: one or two characters expected.", rc_name);
+ OutputMsg(0, "%s:zombie: one or two characters expected.", rc_name);
break;
}
if (args[1])
@@ -1455,7 +1465,7 @@ int key;
{
ZombieKey_onerror = 1;
} else {
- Msg(0, "usage: zombie [keys [onerror]]");
+ OutputMsg(0, "usage: zombie [keys [onerror]]");
break;
}
} else
@@ -1473,7 +1483,7 @@ int key;
{
struct display *olddisplay = display;
display = 0; /* no display will cause a broadcast */
- Msg(0, "%s: %s", s, *args);
+ OutputMsg(0, "%s: %s", s, *args);
display = olddisplay;
}
break;
@@ -1515,7 +1525,7 @@ int key;
if (!u)
{
args[0][n] = '\0';
- Msg(0, "Did not find any user matching '%s'", args[0]);
+ OutputMsg(0, "Did not find any user matching '%s'", args[0]);
break;
}
}
@@ -1532,7 +1542,7 @@ int key;
debug1("AT display %s\n", D_usertty);
DoCommand(args + 1, argl + 1);
if (display)
- Msg(0, "command from %s: %s %s",
+ OutputMsg(0, "command from %s: %s %s",
s, args[1], args[2] ? args[2] : "");
display = NULL;
flayer = 0;
@@ -1561,7 +1571,7 @@ int key;
debug1("AT display %s\n", D_usertty);
DoCommand(args + 1, argl + 1);
if (display)
- Msg(0, "command from %s: %s %s",
+ OutputMsg(0, "command from %s: %s %s",
s, args[1], args[2] ? args[2] : "");
display = NULL;
fore = NULL;
@@ -1606,14 +1616,14 @@ int key;
if (fore && fore->w_layer.l_cvlist)
{
display = fore->w_layer.l_cvlist->c_display;
- Msg(0, "command from %s: %s %s",
+ OutputMsg(0, "command from %s: %s %s",
s, args[1], args[2] ? args[2] : "");
}
}
display = NULL;
fore = NULL;
if (i < 0)
- Msg(0, "%s: at '%s': no such window.\n", rc_name, args[0]);
+ OutputMsg(0, "%s: at '%s': no such window.\n", rc_name, args[0]);
break;
}
else if (i < maxwin && (fore = wtab[i]))
@@ -1627,14 +1637,14 @@ int key;
if (fore && fore->w_layer.l_cvlist)
{
display = fore->w_layer.l_cvlist->c_display;
- Msg(0, "command from %s: %s %s",
+ OutputMsg(0, "command from %s: %s %s",
s, args[1], args[2] ? args[2] : "");
}
display = NULL;
fore = NULL;
}
else
- Msg(0, "%s: at [identifier][%%|*|#] command [args]", rc_name);
+ OutputMsg(0, "%s: at [identifier][%%|*|#] command [args]", rc_name);
break;
}
}
@@ -1653,7 +1663,7 @@ int key;
i = FindEncoding(args[1]);
if (i == -1)
{
- Msg(0, "%s: readreg: unknown encoding", rc_name);
+ OutputMsg(0, "%s: readreg: unknown encoding", rc_name);
break;
}
args += 2;
@@ -1672,7 +1682,7 @@ int key;
}
if (*argl != 1)
{
- Msg(0, "%s: copyreg: character, ^x, or (octal) \\032 expected.", rc_name);
+ OutputMsg(0, "%s: copyreg: character, ^x, or (octal) \\032 expected.", rc_name);
break;
}
ch = args[0][0];
@@ -1683,7 +1693,7 @@ int key;
{
if (args[2])
{
- Msg(0, "%s: readreg: too many arguments", rc_name);
+ OutputMsg(0, "%s: readreg: too many arguments", rc_name);
break;
}
if ((s = ReadFile(args[1], &n)))
@@ -1716,7 +1726,7 @@ int key;
i = FindEncoding(args[1]);
if (i == -1)
{
- Msg(0, "%s: register: unknown encoding", rc_name);
+ OutputMsg(0, "%s: register: unknown encoding", rc_name);
break;
}
args += 2;
@@ -1725,12 +1735,12 @@ int key;
#endif
if (argc != 2)
{
- Msg(0, "%s: register: illegal number of arguments.", rc_name);
+ OutputMsg(0, "%s: register: illegal number of arguments.", rc_name);
break;
}
if (*argl != 1)
{
- Msg(0, "%s: register: character, ^x, or (octal) \\032 expected.", rc_name);
+ OutputMsg(0, "%s: register: character, ^x, or (octal) \\032 expected.", rc_name);
break;
}
ch = args[0][0];
@@ -1770,7 +1780,7 @@ int key;
}
if (*argl != 1)
{
- Msg(0, "%s: process: character, ^x, or (octal) \\032 expected.", rc_name);
+ OutputMsg(0, "%s: process: character, ^x, or (octal) \\032 expected.", rc_name);
break;
}
ch = args[0][0];
@@ -1788,7 +1798,7 @@ int key;
{
if (strcmp(s, "-k"))
{
- Msg(0, "%s: stuff: invalid option %s", rc_name, s);
+ OutputMsg(0, "%s: stuff: invalid option %s", rc_name, s);
break;
}
s = args[1];
@@ -1797,7 +1807,7 @@ int key;
break;
if (i == T_OCAPS)
{
- Msg(0, "%s: stuff: unknown key '%s'", rc_name, s);
+ OutputMsg(0, "%s: stuff: unknown key '%s'", rc_name, s);
break;
}
#ifdef MAPKEYS
@@ -1819,7 +1829,7 @@ int key;
ShowWindows(-1);
break;
case RC_VERSION:
- Msg(0, "screen %s", version);
+ OutputMsg(0, "screen %s", version);
break;
case RC_TIME:
if (*args)
@@ -1827,7 +1837,7 @@ int key;
timestring = SaveStr(*args);
break;
}
- Msg(0, "%s", MakeWinMsg(timestring, fore, '%'));
+ OutputMsg(0, "%s", MakeWinMsg(timestring, fore, '%'));
break;
case RC_INFO:
ShowInfo();
@@ -1842,7 +1852,7 @@ int key;
{
if ((ktabp = FindKtab(args[1], 0)) == 0)
{
- Msg(0, "Unknown command class '%s'", args[1]);
+ OutputMsg(0, "Unknown command class '%s'", args[1]);
break;
}
}
@@ -1901,15 +1911,15 @@ int key;
break;
}
if (n < 0 || n >= (int)(sizeof(types)/sizeof(*types)))
- Msg(0, "%s invalid, chose one of %s, %s or %s", *args, types[0], types[1], types[2]);
+ OutputMsg(0, "%s invalid, chose one of %s, %s or %s", *args, types[0], types[1], types[2]);
else
{
breaktype = n;
- Msg(0, "breaktype set to (%d) %s", n, types[n]);
+ OutputMsg(0, "breaktype set to (%d) %s", n, types[n]);
}
}
else
- Msg(0, "breaktype is (%d) %s", breaktype, types[breaktype]);
+ OutputMsg(0, "breaktype is (%d) %s", breaktype, types[breaktype]);
}
break;
case RC_POW_BREAK:
@@ -1943,7 +1953,7 @@ int key;
{
if (!flayer)
{
- Msg(0, "%s: %s: window required", rc_name, comms[nr].name);
+ OutputMsg(0, "%s: %s: window required", rc_name, comms[nr].name);
break;
}
w = flayer->l_width;
@@ -1953,7 +1963,7 @@ int key;
{
if (!display)
{
- Msg(0, "%s: %s: display required", rc_name, comms[nr].name);
+ OutputMsg(0, "%s: %s: display required", rc_name, comms[nr].name);
break;
}
w = D_width;
@@ -1961,7 +1971,7 @@ int key;
}
if (*args && args[0][0] == '-')
{
- Msg(0, "%s: %s: unknown option %s", rc_name, comms[nr].name, *args);
+ OutputMsg(0, "%s: %s: unknown option %s", rc_name, comms[nr].name, *args);
break;
}
if (nr == RC_HEIGHT)
@@ -2008,17 +2018,17 @@ int key;
}
if (*args && args[1] && args[2])
{
- Msg(0, "%s: %s: too many arguments", rc_name, comms[nr].name);
+ OutputMsg(0, "%s: %s: too many arguments", rc_name, comms[nr].name);
break;
}
if (w <= 0)
{
- Msg(0, "Illegal width");
+ OutputMsg(0, "Illegal width");
break;
}
if (h <= 0)
{
- Msg(0, "Illegal height");
+ OutputMsg(0, "Illegal height");
break;
}
if (what == 1)
@@ -2044,11 +2054,11 @@ int key;
break;
}
if (h == D_height)
- Msg(0, "Your termcap does not specify how to change the terminal's width to %d.", w);
+ OutputMsg(0, "Your termcap does not specify how to change the terminal's width to %d.", w);
else if (w == D_width)
- Msg(0, "Your termcap does not specify how to change the terminal's height to %d.", h);
+ OutputMsg(0, "Your termcap does not specify how to change the terminal's height to %d.", h);
else
- Msg(0, "Your termcap does not specify how to change the terminal's resolution to %dx%d.", w, h);
+ OutputMsg(0, "Your termcap does not specify how to change the terminal's resolution to %dx%d.", w, h);
}
}
break;
@@ -2056,9 +2066,10 @@ int key;
if (queryflag >= 0)
{
if (fore)
- Msg(0, "%s", fore->w_title);
+ OutputMsg(0, "%s", fore->w_title);
else
queryflag = -1;
+ break;
}
if (*args == 0)
InputAKA();
@@ -2076,14 +2087,14 @@ int key;
break;
case RC_LASTMSG:
if (D_status_lastmsg)
- Msg(0, "%s", D_status_lastmsg);
+ OutputMsg(0, "%s", D_status_lastmsg);
break;
case RC_SCREEN:
DoScreen("key", args);
break;
case RC_WRAP:
if (ParseSwitch(act, &fore->w_wrap) == 0 && msgok)
- Msg(0, "%cwrap", fore->w_wrap ? '+' : '-');
+ OutputMsg(0, "%cwrap", fore->w_wrap ? '+' : '-');
break;
case RC_FLOW:
if (*args)
@@ -2110,7 +2121,7 @@ int key;
}
SetFlow(fore->w_flow & FLOW_NOW);
if (msgok)
- Msg(0, "%cflow%s", (fore->w_flow & FLOW_NOW) ? '+' : '-',
+ OutputMsg(0, "%cflow%s", (fore->w_flow & FLOW_NOW) ? '+' : '-',
(fore->w_flow & FLOW_AUTOFLAG) ? "(auto)" : "");
break;
#ifdef MULTIUSER
@@ -2144,7 +2155,7 @@ int key;
if (!AclCheckPermWin(D_user, ACL_WRITE, fore))
fore->w_wlockuser = D_user;
}
- Msg(0, "writelock %s", (fore->w_wlock == WLOCK_AUTO) ? "auto" :
+ OutputMsg(0, "writelock %s", (fore->w_wlock == WLOCK_AUTO) ? "auto" :
((fore->w_wlock == WLOCK_OFF) ? "off" : "on"));
break;
#endif
@@ -2179,7 +2190,7 @@ int key;
#endif
if (fore->w_monitor == MON_OFF)
fore->w_monitor = MON_ON;
- Msg(0, "Window %d (%s) is now being monitored for all activity.", fore->w_number, fore->w_title);
+ OutputMsg(0, "Window %d (%s) is now being monitored for all activity.", fore->w_number, fore->w_title);
}
else
{
@@ -2196,7 +2207,7 @@ int key;
if (i < 0)
#endif
fore->w_monitor = MON_OFF;
- Msg(0, "Window %d (%s) is no longer being monitored for activity.", fore->w_number, fore->w_title);
+ OutputMsg(0, "Window %d (%s) is no longer being monitored for activity.", fore->w_number, fore->w_title);
}
break;
#ifdef MULTI
@@ -2216,7 +2227,7 @@ int key;
wliststr = SaveStr(args[1]);
}
if (msgok)
- Msg(0, "windowlist string is '%s'", wliststr);
+ OutputMsg(0, "windowlist string is '%s'", wliststr);
}
else if (!strcmp(*args, "title"))
{
@@ -2227,7 +2238,7 @@ int key;
wlisttit = SaveStr(args[1]);
}
if (msgok)
- Msg(0, "windowlist title is '%s'", wlisttit);
+ OutputMsg(0, "windowlist title is '%s'", wlisttit);
}
else
{
@@ -2244,7 +2255,7 @@ int key;
flag |= WLIST_NESTED;
else
{
- Msg(0, "usage: windowlist [-b] [-g] [-m] [string [string] | title [title]]");
+ OutputMsg(0, "usage: windowlist [-b] [-g] [-m] [string [string] | title [title]]");
break;
}
if (i == argc)
@@ -2257,7 +2268,7 @@ int key;
struct action *ktabp;
if ((ktabp = FindKtab(args[1], 0)) == 0)
{
- Msg(0, "Unknown command class '%s'", args[1]);
+ OutputMsg(0, "Unknown command class '%s'", args[1]);
break;
}
display_help(args[1], ktabp);
@@ -2272,7 +2283,7 @@ int key;
case RC_COPY:
if (flayer->l_layfn != &WinLf)
{
- Msg(0, "Must be on a window layer");
+ OutputMsg(0, "Must be on a window layer");
break;
}
MarkRoutine();
@@ -2285,7 +2296,7 @@ int key;
if (flayer->l_layfn != &WinLf)
{
- Msg(0, "Must be on a window layer");
+ OutputMsg(0, "Must be on a window layer");
break;
}
if (GetHistory() == 0)
@@ -2320,7 +2331,7 @@ int key;
*/
if (args[1] && argl[1] != 1)
{
- Msg(0, "%s: paste destination: character, ^x, or (octal) \\032 expected.",
+ OutputMsg(0, "%s: paste destination: character, ^x, or (octal) \\032 expected.",
rc_name);
break;
}
@@ -2359,7 +2370,7 @@ int key;
}
if (l == 0)
{
- Msg(0, "empty buffer");
+ OutputMsg(0, "empty buffer");
break;
}
/*
@@ -2380,7 +2391,7 @@ int key;
*/
if ((dbuf = (char *)malloc(l)) == 0)
{
- Msg(0, "%s", strnomem);
+ OutputMsg(0, "%s", strnomem);
break;
}
l = 0;
@@ -2442,7 +2453,7 @@ int key;
case RC_WRITEBUF:
if (!user->u_plop.buf)
{
- Msg(0, "empty buffer");
+ OutputMsg(0, "empty buffer");
break;
}
#ifdef ENCODINGS
@@ -2458,7 +2469,7 @@ int key;
enc = FindEncoding(args[1]);
if (enc == -1)
{
- Msg(0, "%s: writebuf: unknown encoding", rc_name);
+ OutputMsg(0, "%s: writebuf: unknown encoding", rc_name);
break;
}
if (enc != oldplop.enc)
@@ -2467,7 +2478,7 @@ int key;
newbuf = malloc(l + 1);
if (!newbuf)
{
- Msg(0, "%s", strnomem);
+ OutputMsg(0, "%s", strnomem);
break;
}
user->u_plop.len = RecodeBuf((unsigned char *)oldplop.buf, oldplop.len, oldplop.enc, enc, (unsigned char *)newbuf);
@@ -2478,7 +2489,7 @@ int key;
}
#endif
if (args[0] && args[1])
- Msg(0, "%s: writebuf: too many arguments", rc_name);
+ OutputMsg(0, "%s: writebuf: too many arguments", rc_name);
else
WriteFile(user, args[0], DUMP_EXCHANGE);
#ifdef ENCODINGS
@@ -2496,7 +2507,7 @@ int key;
i = FindEncoding(args[1]);
if (i == -1)
{
- Msg(0, "%s: readbuf: unknown encoding", rc_name);
+ OutputMsg(0, "%s: readbuf: unknown encoding", rc_name);
break;
}
args += 2;
@@ -2504,7 +2515,7 @@ int key;
#endif
if (args[0] && args[1])
{
- Msg(0, "%s: readbuf: too many arguments", rc_name);
+ OutputMsg(0, "%s: readbuf: too many arguments", rc_name);
break;
}
if ((s = ReadFile(args[0] ? args[0] : BufferFile, &n)))
@@ -2524,7 +2535,7 @@ int key;
case RC_IGNORECASE:
(void)ParseSwitch(act, &search_ic);
if (msgok)
- Msg(0, "Will %signore case in searches", search_ic ? "" : "not ");
+ OutputMsg(0, "Will %signore case in searches", search_ic ? "" : "not ");
break;
#endif /* COPY_PASTE */
case RC_ESCAPE:
@@ -2534,7 +2545,7 @@ int key;
SetEscape(user, (int)(unsigned char)args[0][0], (int)(unsigned char)args[0][1]);
else
{
- Msg(0, "%s: two characters required after escape.", rc_name);
+ OutputMsg(0, "%s: two characters required after escape.", rc_name);
break;
}
/* Change defescape if master user. This is because we only
@@ -2550,7 +2561,7 @@ int key;
SetEscape(NULL, (int)(unsigned char)args[0][0], (int)(unsigned char)args[0][1]);
else
{
- Msg(0, "%s: two characters required after defescape.", rc_name);
+ OutputMsg(0, "%s: two characters required after defescape.", rc_name);
break;
}
#ifdef MAPKEYS
@@ -2560,7 +2571,7 @@ int key;
case RC_CHDIR:
s = *args ? *args : home;
if (chdir(s) == -1)
- Msg(errno, "%s", s);
+ OutputMsg(errno, "%s", s);
break;
case RC_SHELL:
case RC_DEFSHELL:
@@ -2571,7 +2582,7 @@ int key;
if (*args)
(void)ParseSaveStr(act, &hardcopydir);
if (msgok)
- Msg(0, "hardcopydir is %s\n", hardcopydir && *hardcopydir ? hardcopydir : "<cwd>");
+ OutputMsg(0, "hardcopydir is %s\n", hardcopydir && *hardcopydir ? hardcopydir : "<cwd>");
break;
case RC_LOGFILE:
if (*args)
@@ -2580,19 +2591,19 @@ int key;
{
log_flush = atoi(args[1]);
if (msgok)
- Msg(0, "log flush timeout set to %ds\n", log_flush);
+ OutputMsg(0, "log flush timeout set to %ds\n", log_flush);
break;
}
if (ParseSaveStr(act, &screenlogfile) || !msgok)
break;
}
- Msg(0, "logfile is '%s'", screenlogfile);
+ OutputMsg(0, "logfile is '%s'", screenlogfile);
break;
case RC_LOGTSTAMP:
if (!*args || !strcmp(*args, "on") || !strcmp(*args, "off"))
{
if (ParseSwitch(act, &logtstamp_on) == 0 && msgok)
- Msg(0, "timestamps turned %s", logtstamp_on ? "on" : "off");
+ OutputMsg(0, "timestamps turned %s", logtstamp_on ? "on" : "off");
}
else if (!strcmp(*args, "string"))
{
@@ -2603,7 +2614,7 @@ int key;
logtstamp_string = SaveStr(args[1]);
}
if (msgok)
- Msg(0, "logfile timestamp is '%s'", logtstamp_string);
+ OutputMsg(0, "logfile timestamp is '%s'", logtstamp_string);
}
else if (!strcmp(*args, "after"))
{
@@ -2613,10 +2624,10 @@ int key;
if (!msgok)
break;
}
- Msg(0, "timestamp printed after %ds\n", logtstamp_after);
+ OutputMsg(0, "timestamp printed after %ds\n", logtstamp_after);
}
else
- Msg(0, "usage: logtstamp [after [n]|string [str]|on|off]");
+ OutputMsg(0, "usage: logtstamp [after [n]|string [str]|on|off]");
break;
case RC_SHELLTITLE:
(void)ParseSaveStr(act, &nwin_default.aka);
@@ -2625,7 +2636,7 @@ int key;
case RC_TERMCAPINFO:
case RC_TERMINFO:
if (!rc_name || !*rc_name)
- Msg(0, "Sorry, too late now. Place that in your .screenrc file.");
+ OutputMsg(0, "Sorry, too late now. Place that in your .screenrc file.");
break;
case RC_SLEEP:
break; /* Already handled */
@@ -2635,7 +2646,7 @@ int key;
break;
if (strlen(s) >= 20)
{
- Msg(0, "%s: term: argument too long ( < 20)", rc_name);
+ OutputMsg(0, "%s: term: argument too long ( < 20)", rc_name);
free(s);
break;
}
@@ -2667,10 +2678,10 @@ int key;
s = MakeWinMsg(s, fore, '%');
}
if (s)
- Msg(0, "%s", s);
+ OutputMsg(0, "%s", s);
else
{
- Msg(0, "%s: 'echo [-n] [-p] \"string\"' expected.", rc_name);
+ OutputMsg(0, "%s: 'echo [-n] [-p] \"string\"' expected.", rc_name);
queryflag = -1;
}
break;
@@ -2680,7 +2691,7 @@ int key;
{
char buf[256];
AddXChars(buf, sizeof(buf), BellString);
- Msg(0, "bell_msg is '%s'", buf);
+ OutputMsg(0, "bell_msg is '%s'", buf);
break;
}
(void)ParseSaveStr(act, &BellString);
@@ -2692,7 +2703,7 @@ int key;
else if (ParseSaveStr(act, &BufferFile))
break;
if (msgok)
- Msg(0, "Bufferfile is now '%s'", BufferFile);
+ OutputMsg(0, "Bufferfile is now '%s'", BufferFile);
break;
#endif
case RC_ACTIVITY:
@@ -2704,7 +2715,7 @@ int key;
{
char buf[256];
AddXChars(buf, sizeof(buf), PowDetachString);
- Msg(0, "pow_detach_msg is '%s'", buf);
+ OutputMsg(0, "pow_detach_msg is '%s'", buf);
break;
}
(void)ParseSaveStr(act, &PowDetachString);
@@ -2786,7 +2797,7 @@ int key;
case RC_MOUSETRACK:
if (!args[0])
{
- Msg(0, "Mouse tracking for this display is turned %s", D_mousetrack ? "on" : "off");
+ OutputMsg(0, "Mouse tracking for this display is turned %s", D_mousetrack ? "on" : "off");
}
else if (ParseOnOff(act, &n) == 0)
{
@@ -2801,7 +2812,7 @@ int key;
break;
case RC_VERBOSE:
if (!*args)
- Msg(0, "W%s echo command when creating windows.",
+ OutputMsg(0, "W%s echo command when creating windows.",
VerboseCreate ? "ill" : "on't");
else if (ParseOnOff(act, &n) == 0)
VerboseCreate = n;
@@ -2809,7 +2820,7 @@ int key;
case RC_HARDSTATUS:
if (display)
{
- Msg(0, "%s", ""); /* wait till mintime (keep gcc quiet) */
+ OutputMsg(0, "%s", ""); /* wait till mintime (keep gcc quiet) */
RemoveStatus();
}
if (args[0] && strcmp(args[0], "on") && strcmp(args[0], "off"))
@@ -2832,13 +2843,13 @@ int key;
{
char buf[256];
AddXChars(buf, sizeof(buf), hstatusstring);
- Msg(0, "hardstatus string is '%s'", buf);
+ OutputMsg(0, "hardstatus string is '%s'", buf);
break;
}
}
else
{
- Msg(0, "%s: usage: hardstatus [always]lastline|ignore|message|string [string]", rc_name);
+ OutputMsg(0, "%s: usage: hardstatus [always]lastline|ignore|message|string [string]", rc_name);
break;
}
if (new_use != -1)
@@ -2871,7 +2882,7 @@ int key;
}
(void)ParseSwitch(act, &use_hardstatus);
if (msgok)
- Msg(0, "messages displayed on %s", use_hardstatus ? "hardstatus line" : "window");
+ OutputMsg(0, "messages displayed on %s", use_hardstatus ? "hardstatus line" : "window");
break;
case RC_CAPTION:
if (strcmp(args[0], "always") == 0 || strcmp(args[0], "splitonly") == 0)
@@ -2889,13 +2900,13 @@ int key;
{
char buf[256];
AddXChars(buf, sizeof(buf), captionstring);
- Msg(0, "caption string is '%s'", buf);
+ OutputMsg(0, "caption string is '%s'", buf);
break;
}
}
else
{
- Msg(0, "%s: usage: caption always|splitonly|string <string>", rc_name);
+ OutputMsg(0, "%s: usage: caption always|splitonly|string <string>", rc_name);
break;
}
if (!args[1])
@@ -2912,12 +2923,12 @@ int key;
if (TtyGrabConsole(fore->w_ptyfd, n, rc_name))
break;
if (n == 0)
- Msg(0, "%s: releasing console %s", rc_name, HostName);
+ OutputMsg(0, "%s: releasing console %s", rc_name, HostName);
else if (console_window)
- Msg(0, "%s: stealing console %s from window %d (%s)", rc_name,
+ OutputMsg(0, "%s: stealing console %s from window %d (%s)", rc_name,
HostName, console_window->w_number, console_window->w_title);
else
- Msg(0, "%s: grabbing console %s", rc_name, HostName);
+ OutputMsg(0, "%s: grabbing console %s", rc_name, HostName);
console_window = n ? fore : 0;
break;
case RC_ALLPARTIAL:
@@ -2926,7 +2937,7 @@ int key;
if (!all_norefresh && fore)
Activate(-1);
if (msgok)
- Msg(0, all_norefresh ? "No refresh on window change!\n" :
+ OutputMsg(0, all_norefresh ? "No refresh on window change!\n" :
"Window specific refresh\n");
break;
case RC_PARTIAL:
@@ -2937,21 +2948,21 @@ int key;
if (ParseSwitch(act, &visual_bell) || !msgok)
break;
if (visual_bell == 0)
- Msg(0, "switched to audible bell.");
+ OutputMsg(0, "switched to audible bell.");
else
- Msg(0, "switched to visual bell.");
+ OutputMsg(0, "switched to visual bell.");
break;
case RC_VBELLWAIT:
if (ParseNum1000(act, &VBellWait) == 0 && msgok)
- Msg(0, "vbellwait set to %.10g seconds", VBellWait/1000.);
+ OutputMsg(0, "vbellwait set to %.10g seconds", VBellWait/1000.);
break;
case RC_MSGWAIT:
if (ParseNum1000(act, &MsgWait) == 0 && msgok)
- Msg(0, "msgwait set to %.10g seconds", MsgWait/1000.);
+ OutputMsg(0, "msgwait set to %.10g seconds", MsgWait/1000.);
break;
case RC_MSGMINWAIT:
if (ParseNum1000(act, &MsgMinWait) == 0 && msgok)
- Msg(0, "msgminwait set to %.10g seconds", MsgMinWait/1000.);
+ OutputMsg(0, "msgminwait set to %.10g seconds", MsgMinWait/1000.);
break;
case RC_SILENCEWAIT:
if (ParseNum(act, &SilenceWait))
@@ -2961,11 +2972,11 @@ int key;
for (p = windows; p; p = p->w_next)
p->w_silencewait = SilenceWait;
if (msgok)
- Msg(0, "silencewait set to %d seconds", SilenceWait);
+ OutputMsg(0, "silencewait set to %d seconds", SilenceWait);
break;
case RC_NUMBER:
if (*args == 0)
- Msg(0, queryflag >= 0 ? "%d (%s)" : "This is window %d (%s).", fore->w_number, fore->w_title);
+ OutputMsg(0, queryflag >= 0 ? "%d (%s)" : "This is window %d (%s).", fore->w_number, fore->w_title);
else
{
int old = fore->w_number;
@@ -3020,7 +3031,7 @@ int key;
if (!msgok)
break;
- Msg(0, "The window is now being monitored for %d sec. silence.", fore->w_silencewait);
+ OutputMsg(0, "The window is now being monitored for %d sec. silence.", fore->w_silencewait);
}
else
{
@@ -3042,7 +3053,7 @@ int key;
}
if (!msgok)
break;
- Msg(0, "The window is no longer being monitored for silence.");
+ OutputMsg(0, "The window is no longer being monitored for silence.");
}
break;
#ifdef COPY_PASTE
@@ -3052,18 +3063,18 @@ int key;
case RC_SCROLLBACK:
if (flayer->l_layfn == &MarkLf)
{
- Msg(0, "Cannot resize scrollback buffer in copy/scrollback mode.");
+ OutputMsg(0, "Cannot resize scrollback buffer in copy/scrollback mode.");
break;
}
(void)ParseNum(act, &n);
ChangeWindowSize(fore, fore->w_width, fore->w_height, n);
if (msgok)
- Msg(0, "scrollback set to %d", fore->w_histheight);
+ OutputMsg(0, "scrollback set to %d", fore->w_histheight);
break;
#endif
case RC_SESSIONNAME:
if (*args == 0)
- Msg(0, "This session is named '%s'\n", SockName);
+ OutputMsg(0, "This session is named '%s'\n", SockName);
else
{
char buf[MAXPATHLEN];
@@ -3073,7 +3084,7 @@ int key;
break;
if (!*s || strlen(s) + (SockName - SockPath) > MAXPATHLEN - 13 || index(s, '/'))
{
- Msg(0, "%s: bad session name '%s'\n", rc_name, s);
+ OutputMsg(0, "%s: bad session name '%s'\n", rc_name, s);
free(s);
break;
}
@@ -3082,12 +3093,12 @@ int key;
free(s);
if ((access(buf, F_OK) == 0) || (errno != ENOENT))
{
- Msg(0, "%s: inappropriate path: '%s'.", rc_name, buf);
+ OutputMsg(0, "%s: inappropriate path: '%s'.", rc_name, buf);
break;
}
if (rename(SockPath, buf))
{
- Msg(errno, "%s: failed to rename(%s, %s)", rc_name, SockPath, buf);
+ OutputMsg(errno, "%s: failed to rename(%s, %s)", rc_name, SockPath, buf);
break;
}
debug2("rename(%s, %s) done\n", SockPath, buf);
@@ -3118,12 +3129,12 @@ int key;
break;
case RC_SLOWPASTE:
if (*args == 0)
- Msg(0, fore->w_slowpaste ?
+ OutputMsg(0, fore->w_slowpaste ?
"Slowpaste in window %d is %d milliseconds." :
"Slowpaste in window %d is unset.",
fore->w_number, fore->w_slowpaste);
else if (ParseNum(act, &fore->w_slowpaste) == 0 && msgok)
- Msg(0, fore->w_slowpaste ?
+ OutputMsg(0, fore->w_slowpaste ?
"Slowpaste in window %d set to %d milliseconds." :
"Slowpaste in window %d now unset.",
fore->w_number, fore->w_slowpaste);
@@ -3131,7 +3142,7 @@ int key;
case RC_MARKKEYS:
if (CompileKeys(*args, *argl, mark_key_tab))
{
- Msg(0, "%s: markkeys: syntax error.", rc_name);
+ OutputMsg(0, "%s: markkeys: syntax error.", rc_name);
break;
}
debug1("markkeys %s\n", *args);
@@ -3139,7 +3150,7 @@ int key;
# ifdef FONT
case RC_PASTEFONT:
if (ParseSwitch(act, &pastefont) == 0 && msgok)
- Msg(0, "Will %spaste font settings", pastefont ? "" : "not ");
+ OutputMsg(0, "Will %spaste font settings", pastefont ? "" : "not ");
break;
# endif
case RC_CRLF:
@@ -3147,7 +3158,7 @@ int key;
break;
case RC_COMPACTHIST:
if (ParseSwitch(act, &compacthist) == 0 && msgok)
- Msg(0, "%scompacting history lines", compacthist ? "" : "not ");
+ OutputMsg(0, "%scompacting history lines", compacthist ? "" : "not ");
break;
#endif
#ifdef NETHACK
@@ -3163,7 +3174,7 @@ int key;
{
char buf[256];
AddXChars(buf, sizeof(buf), VisualBellString);
- Msg(0, "vbell_msg is '%s'", buf);
+ OutputMsg(0, "vbell_msg is '%s'", buf);
break;
}
(void)ParseSaveStr(act, &VisualBellString);
@@ -3174,12 +3185,12 @@ int key;
break;
if (n < 0 || n > 0777)
{
- Msg(0, "%s: mode: Invalid tty mode %o", rc_name, n);
+ OutputMsg(0, "%s: mode: Invalid tty mode %o", rc_name, n);
break;
}
TtyMode = n;
if (msgok)
- Msg(0, "Ttymode set to %03o", TtyMode);
+ OutputMsg(0, "Ttymode set to %03o", TtyMode);
break;
case RC_AUTODETACH:
(void)ParseOnOff(act, &auto_detach);
@@ -3197,7 +3208,7 @@ int key;
if (!strcmp(user->u_password, "none"))
{
if (n)
- Msg(0, "Password checking disabled");
+ OutputMsg(0, "Password checking disabled");
free(user->u_password);
user->u_password = NullStr;
}
@@ -3206,7 +3217,7 @@ int key;
{
if (!fore)
{
- Msg(0, "%s: password: window required", rc_name);
+ OutputMsg(0, "%s: password: window required", rc_name);
break;
}
Input("New screen password:", 100, INP_NOECHO, pass1, display ? (char *)D_user : (char *)users, 0);
@@ -3247,7 +3258,7 @@ int key;
break;
if (n == KMAP_KEYS)
{
- Msg(0, "%s: bind: unknown key '%s'", rc_name, *args);
+ OutputMsg(0, "%s: bind: unknown key '%s'", rc_name, *args);
break;
}
n += 256;
@@ -3256,7 +3267,7 @@ int key;
#endif
if (*argl != 1)
{
- Msg(0, "%s: bind: character, ^x, or (octal) \\032 expected.", rc_name);
+ OutputMsg(0, "%s: bind: character, ^x, or (octal) \\032 expected.", rc_name);
break;
}
else
@@ -3266,7 +3277,7 @@ int key;
{
if ((i = FindCommnr(args[1])) == RC_ILLEGAL)
{
- Msg(0, "%s: bind: unknown command '%s'", rc_name, args[1]);
+ OutputMsg(0, "%s: bind: unknown command '%s'", rc_name, args[1]);
break;
}
if (CheckArgNum(i, args + 2) < 0)
@@ -3307,13 +3318,13 @@ int key;
}
else
{
- Msg(0, "%s: bindkey: invalid option %s", rc_name, *args);
+ OutputMsg(0, "%s: bindkey: invalid option %s", rc_name, *args);
return;
}
}
if (df && mf)
{
- Msg(0, "%s: bindkey: -d does not work with -m", rc_name);
+ OutputMsg(0, "%s: bindkey: -d does not work with -m", rc_name);
break;
}
if (*args == 0)
@@ -3330,12 +3341,12 @@ int key;
{
if (af)
{
- Msg(0, "%s: bindkey: -a only works with -k", rc_name);
+ OutputMsg(0, "%s: bindkey: -a only works with -k", rc_name);
break;
}
if (*argl == 0)
{
- Msg(0, "%s: bindkey: empty string makes no sense", rc_name);
+ OutputMsg(0, "%s: bindkey: empty string makes no sense", rc_name);
break;
}
for (i = 0, kme = kmap_exts; i < kmap_extn; i++, kme++)
@@ -3351,7 +3362,7 @@ int key;
{
if (!args[1])
{
- Msg(0, "%s: bindkey: keybinding not found", rc_name);
+ OutputMsg(0, "%s: bindkey: keybinding not found", rc_name);
break;
}
kmap_extn += 8;
@@ -3384,7 +3395,7 @@ int key;
break;
if (i == T_OCAPS)
{
- Msg(0, "%s: bindkey: unknown key '%s'", rc_name, *args);
+ OutputMsg(0, "%s: bindkey: unknown key '%s'", rc_name, *args);
break;
}
if (af && i >= T_CURSOR && i < T_OCAPS)
@@ -3397,7 +3408,7 @@ int key;
{
if ((newnr = FindCommnr(args[1])) == RC_ILLEGAL)
{
- Msg(0, "%s: bindkey: unknown command '%s'", rc_name, args[1]);
+ OutputMsg(0, "%s: bindkey: unknown command '%s'", rc_name, args[1]);
break;
}
if (CheckArgNum(newnr, args + 2) < 0)
@@ -3435,13 +3446,13 @@ int key;
break;
if (n < 0)
{
- Msg(0, "%s: maptimeout: illegal time %d", rc_name, n);
+ OutputMsg(0, "%s: maptimeout: illegal time %d", rc_name, n);
break;
}
maptimeout = n;
}
if (*args == 0 || msgok)
- Msg(0, "maptimeout is %dms", maptimeout);
+ OutputMsg(0, "maptimeout is %dms", maptimeout);
break;
case RC_MAPNOTNEXT:
D_dontmap = 1;
@@ -3461,7 +3472,7 @@ int key;
if (UserDel(args[0], NULL))
break;
if (msgok)
- Msg(0, "%s removed from acl database", args[0]);
+ OutputMsg(0, "%s removed from acl database", args[0]);
break;
case RC_ACLGRP:
/*
@@ -3476,7 +3487,7 @@ int key;
if (AclLinkUser(args[0], args[1]))
break;
if (msgok)
- Msg(0, "User %s joined acl-group %s", args[0], args[1]);
+ OutputMsg(0, "User %s joined acl-group %s", args[0], args[1]);
}
else /* remove all groups from user */
{
@@ -3502,7 +3513,7 @@ int key;
if (!(u = *FindUserPtr(args[0])))
{
if (msgok)
- Msg(0, "User %s does not exist.", args[0]);
+ OutputMsg(0, "User %s does not exist.", args[0]);
break;
}
g = u->u_group;
@@ -3517,7 +3528,7 @@ int key;
}
if (ngroups)
*(--p) = '\0';
- Msg(0, "%s's group%s: %s.", args[0], (ngroups == 1) ? "" : "s",
+ OutputMsg(0, "%s's group%s: %s.", args[0], (ngroups == 1) ? "" : "s",
(ngroups == 0) ? "none" : buf);
}
break;
@@ -3528,7 +3539,7 @@ int key;
char *err = 0;
if (AclUmask(display ? D_user : users, s, &err))
- Msg(0, "umask: %s\n", err);
+ OutputMsg(0, "umask: %s\n", err);
}
break;
case RC_MULTIUSER:
@@ -3537,7 +3548,7 @@ int key;
multi = n ? "" : 0;
chsock();
if (msgok)
- Msg(0, "Multiuser mode %s", multi ? "enabled" : "disabled");
+ OutputMsg(0, "Multiuser mode %s", multi ? "enabled" : "disabled");
break;
#endif /* MULTIUSER */
#ifdef PSEUDOS
@@ -3558,11 +3569,11 @@ int key;
else
break;
if (msgok && i == -1)
- Msg(0, "display set to blocking mode");
+ OutputMsg(0, "display set to blocking mode");
else if (msgok && i == 0)
- Msg(0, "display set to nonblocking mode, no timeout");
+ OutputMsg(0, "display set to nonblocking mode, no timeout");
else if (msgok)
- Msg(0, "display set to nonblocking mode, %.10gs timeout", i/1000.);
+ OutputMsg(0, "display set to nonblocking mode, %.10gs timeout", i/1000.);
D_nonblock = i;
if (D_nonblock <= 0)
evdeq(&D_blockedev);
@@ -3591,7 +3602,7 @@ int key;
fore->w_gr = 0;
#endif
if (ParseSwitch(act, &fore->w_gr) == 0 && msgok)
- Msg(0, "Will %suse GR", fore->w_gr ? "" : "not ");
+ OutputMsg(0, "Will %suse GR", fore->w_gr ? "" : "not ");
#ifdef ENCODINGS
if (fore->w_gr == 0 && fore->w_FontE)
fore->w_gr = 2;
@@ -3599,12 +3610,12 @@ int key;
break;
case RC_C1:
if (ParseSwitch(act, &fore->w_c1) == 0 && msgok)
- Msg(0, "Will %suse C1", fore->w_c1 ? "" : "not ");
+ OutputMsg(0, "Will %suse C1", fore->w_c1 ? "" : "not ");
break;
#ifdef COLOR
case RC_BCE:
if (ParseSwitch(act, &fore->w_bce) == 0 && msgok)
- Msg(0, "Will %serase with background color", fore->w_bce ? "" : "not ");
+ OutputMsg(0, "Will %serase with background color", fore->w_bce ? "" : "not ");
break;
#endif
#ifdef ENCODINGS
@@ -3614,7 +3625,7 @@ int key;
if (*args && !strcmp(args[0], "-d"))
{
if (!args[1])
- Msg(0, "encodings directory is %s", screenencodings ? screenencodings : "<unset>");
+ OutputMsg(0, "encodings directory is %s", screenencodings ? screenencodings : "<unset>");
else
{
free(screenencodings);
@@ -3625,18 +3636,18 @@ int key;
if (*args && !strcmp(args[0], "-l"))
{
if (!args[1])
- Msg(0, "encoding: -l: argument required");
+ OutputMsg(0, "encoding: -l: argument required");
else if (LoadFontTranslation(-1, args[1]))
- Msg(0, "encoding: could not load utf8 encoding file");
+ OutputMsg(0, "encoding: could not load utf8 encoding file");
else if (msgok)
- Msg(0, "encoding: utf8 encoding file loaded");
+ OutputMsg(0, "encoding: utf8 encoding file loaded");
break;
}
#else
if (*args && (!strcmp(args[0], "-l") || !strcmp(args[0], "-d")))
{
if (msgok)
- Msg(0, "encoding: screen is not compiled for UTF-8.");
+ OutputMsg(0, "encoding: screen is not compiled for UTF-8.");
break;
}
#endif
@@ -3649,7 +3660,7 @@ int key;
n = FindEncoding(args[i]);
if (n == -1)
{
- Msg(0, "encoding: unknown encoding '%s'", args[i]);
+ OutputMsg(0, "encoding: unknown encoding '%s'", args[i]);
break;
}
if (i == 0 && fore)
@@ -3666,7 +3677,7 @@ int key;
n = FindEncoding(*args);
if (n == -1)
{
- Msg(0, "defencoding: unknown encoding '%s'", *args);
+ OutputMsg(0, "defencoding: unknown encoding '%s'", *args);
break;
}
nwin_default.encoding = n;
@@ -3680,7 +3691,7 @@ int key;
{
nwin_default.encoding = n ? UTF8 : 0;
if (msgok)
- Msg(0, "Will %suse UTF-8 encoding for new windows", n ? "" : "not ");
+ OutputMsg(0, "Will %suse UTF-8 encoding for new windows", n ? "" : "not ");
}
break;
case RC_UTF8:
@@ -3696,14 +3707,14 @@ int key;
n = 1;
else
{
- Msg(0, "utf8: illegal argument (%s)", args[i]);
+ OutputMsg(0, "utf8: illegal argument (%s)", args[i]);
break;
}
if (i == 0)
{
WinSwitchEncoding(fore, n ? UTF8 : 0);
if (msgok)
- Msg(0, "Will %suse UTF-8 encoding", n ? "" : "not ");
+ OutputMsg(0, "Will %suse UTF-8 encoding", n ? "" : "not ");
}
else if (display)
D_encoding = n ? UTF8 : 0;
@@ -3725,9 +3736,9 @@ int key;
if (*args == 0 || msgok)
{
if (printcmd)
- Msg(0, "using '%s' as print command", printcmd);
+ OutputMsg(0, "using '%s' as print command", printcmd);
else
- Msg(0, "using termcap entries for printing");
+ OutputMsg(0, "using termcap entries for printing");
break;
}
break;
@@ -3737,7 +3748,7 @@ int key;
{
if (argl[0] != 2)
{
- Msg(0, "Two characters expected to define a digraph");
+ OutputMsg(0, "Two characters expected to define a digraph");
break;
}
i = digraph_find(args[0]);
@@ -3788,7 +3799,7 @@ int key;
*buf = 0;
if (nwin_default.hstatus)
AddXChars(buf, sizeof(buf), nwin_default.hstatus);
- Msg(0, "default hstatus is '%s'", buf);
+ OutputMsg(0, "default hstatus is '%s'", buf);
break;
}
(void)ParseSaveStr(act, &nwin_default.hstatus);
@@ -3817,20 +3828,20 @@ int key;
*buf = 0;
if (nwin_default.charset)
AddXChars(buf, sizeof(buf), nwin_default.charset);
- Msg(0, "default charset is '%s'", buf);
+ OutputMsg(0, "default charset is '%s'", buf);
break;
}
n = strlen(*args);
if (n == 0 || n > 6)
{
- Msg(0, "%s: %s: string has illegal size.", rc_name, comms[nr].name);
+ OutputMsg(0, "%s: %s: string has illegal size.", rc_name, comms[nr].name);
break;
}
if (n > 4 && (
((args[0][4] < '0' || args[0][4] > '3') && args[0][4] != '.') ||
((args[0][5] < '0' || args[0][5] > '3') && args[0][5] && args[0][5] != '.')))
{
- Msg(0, "%s: %s: illegal mapping number.", rc_name, comms[nr].name);
+ OutputMsg(0, "%s: %s: illegal mapping number.", rc_name, comms[nr].name);
break;
}
if (nr == RC_CHARSET)
@@ -3868,7 +3879,7 @@ int key;
}
if (*s || i < 0 || i >= 8)
{
- Msg(0, "%s: attrcolor: unknown attribute '%s'.", rc_name, args[0]);
+ OutputMsg(0, "%s: attrcolor: unknown attribute '%s'.", rc_name, args[0]);
break;
}
n = 0;
@@ -3894,9 +3905,13 @@ int key;
{
i = REND_MONITOR;
}
+ else if (strcmp(args[0], "silence") == 0)
+ {
+ i = REND_SILENCE;
+ }
else if (strcmp(args[0], "so") != 0)
{
- Msg(0, "Invalid option '%s' for rendition", args[0]);
+ OutputMsg(0, "Invalid option '%s' for rendition", args[0]);
break;
}
@@ -3927,9 +3942,9 @@ int key;
}
if (msgok)
#ifdef COLOR
- Msg(0, "Standout attributes 0x%02x color 0x%02x", (unsigned char)mchar_so.attr, 0x99 ^ (unsigned char)mchar_so.color);
+ OutputMsg(0, "Standout attributes 0x%02x color 0x%02x", (unsigned char)mchar_so.attr, 0x99 ^ (unsigned char)mchar_so.color);
#else
- Msg(0, "Standout attributes 0x%02x ", (unsigned char)mchar_so.attr);
+ OutputMsg(0, "Standout attributes 0x%02x ", (unsigned char)mchar_so.attr);
#endif
break;
@@ -3942,7 +3957,7 @@ int key;
s = NULL;
if (!*args)
{
- Msg(0, "%s:%s screen login", HostName, SockPath);
+ OutputMsg(0, "%s:%s screen login", HostName, SockPath);
InputSu(D_fore, &D_user, NULL);
}
else if (!args[1])
@@ -3952,7 +3967,7 @@ int key;
else
s = DoSu(&D_user, args[0], args[1], args[2]);
if (s)
- Msg(0, "%s", s);
+ OutputMsg(0, "%s", s);
break;
#endif /* MULTIUSER */
case RC_SPLIT:
@@ -4006,7 +4021,7 @@ int key;
cv = FindCanvas(D_forecv->c_xe + 1, D_forecv->c_ys);
else
{
- Msg(0, "%s: usage: focus [next|prev|up|down|left|right|top|bottom]", rc_name);
+ OutputMsg(0, "%s: usage: focus [next|prev|up|down|left|right|top|bottom]", rc_name);
break;
}
SetForeCanvas(display, cv);
@@ -4016,7 +4031,7 @@ int key;
i = 0;
if (D_forecv->c_slorient == SLICE_UNKN)
{
- Msg(0, "resize: need more than one region");
+ OutputMsg(0, "resize: need more than one region");
break;
}
for (; *args; args++)
@@ -4036,7 +4051,7 @@ int key;
}
if (*args && args[1])
{
- Msg(0, "%s: usage: resize [-h] [-v] [-l] [num]\n", rc_name);
+ OutputMsg(0, "%s: usage: resize [-h] [-v] [-l] [num]\n", rc_name);
break;
}
if (*args)
@@ -4060,22 +4075,22 @@ int key;
case RC_ALTSCREEN:
(void)ParseSwitch(act, &use_altscreen);
if (msgok)
- Msg(0, "Will %sdo alternate screen switching", use_altscreen ? "" : "not ");
+ OutputMsg(0, "Will %sdo alternate screen switching", use_altscreen ? "" : "not ");
break;
case RC_MAXWIN:
if (!args[0])
{
- Msg(0, "maximum windows allowed: %d", maxwin);
+ OutputMsg(0, "maximum windows allowed: %d", maxwin);
break;
}
if (ParseNum(act, &n))
break;
if (n < 1)
- Msg(0, "illegal maxwin number specified");
+ OutputMsg(0, "illegal maxwin number specified");
else if (n > 2048)
- Msg(0, "maximum 2048 windows allowed");
+ OutputMsg(0, "maximum 2048 windows allowed");
else if (n > maxwin && windows)
- Msg(0, "may increase maxwin only when there's no window");
+ OutputMsg(0, "may increase maxwin only when there's no window");
else
{
if (!windows)
@@ -4093,7 +4108,7 @@ int key;
int lifespan, tick;
if (argc < 4)
{
- Msg(0, "%s: usage: backtick num [lifespan tick cmd args...]", rc_name);
+ OutputMsg(0, "%s: usage: backtick num [lifespan tick cmd args...]", rc_name);
break;
}
if (ParseBase(act, args[1], &lifespan, 10, "decimal"))
@@ -4127,10 +4142,10 @@ int key;
for (pp = blankerprg; *pp; pp++)
p += snprintf(p, sizeof(path) - (p - path) - 1, "%s ", *pp);
*(p - 1) = '\0';
- Msg(0, "blankerprg: %s", path);
+ OutputMsg(0, "blankerprg: %s", path);
}
else
- Msg(0, "No blankerprg set.");
+ OutputMsg(0, "No blankerprg set.");
break;
}
if (blankerprg)
@@ -4157,7 +4172,7 @@ int key;
{
if ((i = FindCommnr(args[1])) == RC_ILLEGAL)
{
- Msg(0, "%s: idle: unknown command '%s'", rc_name, args[1]);
+ OutputMsg(0, "%s: idle: unknown command '%s'", rc_name, args[1]);
break;
}
if (CheckArgNum(i, args + 2) < 0)
@@ -4172,9 +4187,9 @@ int key;
if (msgok)
{
if (idletimo)
- Msg(0, "idle timeout %ds, %s", idletimo / 1000, comms[idleaction.nr].name);
+ OutputMsg(0, "idle timeout %ds, %s", idletimo / 1000, comms[idleaction.nr].name);
else
- Msg(0, "idle off");
+ OutputMsg(0, "idle off");
}
break;
case RC_FOCUSMINSIZE:
@@ -4200,7 +4215,7 @@ int key;
else
sprintf(b[i], "%d", n);
}
- Msg(0, "focus min size is %s %s\n", b[0], b[1]);
+ OutputMsg(0, "focus min size is %s %s\n", b[0], b[1]);
}
break;
case RC_GROUP:
@@ -4220,9 +4235,9 @@ int key;
if (msgok)
{
if (fore->w_group)
- Msg(0, "window group is %d (%s)\n", fore->w_group->w_number, fore->w_group->w_title);
+ OutputMsg(0, "window group is %d (%s)\n", fore->w_group->w_number, fore->w_group->w_title);
else
- Msg(0, "window belongs to no group");
+ OutputMsg(0, "window belongs to no group");
}
break;
case RC_LAYOUT:
@@ -4230,12 +4245,12 @@ int key;
{
if (!D_layout)
{
- Msg(0, "not on a layout");
+ OutputMsg(0, "not on a layout");
break;
}
if (!args[1])
{
- Msg(0, "current layout is %d (%s)", D_layout->lay_number, D_layout->lay_title);
+ OutputMsg(0, "current layout is %d (%s)", D_layout->lay_number, D_layout->lay_title);
break;
}
free(D_layout->lay_title);
@@ -4247,12 +4262,12 @@ int key;
struct layout *lay;
if (!D_layout)
{
- Msg(0, "not on a layout");
+ OutputMsg(0, "not on a layout");
break;
}
if (!args[1])
{
- Msg(0, "This is layout %d (%s).\n", D_layout->lay_number, D_layout->lay_title);
+ OutputMsg(0, "This is layout %d (%s).\n", D_layout->lay_number, D_layout->lay_title);
break;
}
old = D_layout->lay_number;
@@ -4271,7 +4286,7 @@ int key;
{
if (!D_layout)
{
- Msg(0, "not on a layout");
+ OutputMsg(0, "not on a layout");
break;
}
if (args[1])
@@ -4282,12 +4297,12 @@ int key;
D_layout->lay_autosave = 0;
else
{
- Msg(0, "invalid argument. Give 'on' or 'off");
+ OutputMsg(0, "invalid argument. Give 'on' or 'off");
break;
}
}
if (msgok)
- Msg(0, "autosave is %s", D_layout->lay_autosave ? "on" : "off");
+ OutputMsg(0, "autosave is %s", D_layout->lay_autosave ? "on" : "off");
}
else if (!strcmp(args[0], "new"))
{
@@ -4315,7 +4330,7 @@ int key;
{
if (!args[1])
{
- Msg(0, "usage: layout save <name>");
+ OutputMsg(0, "usage: layout save <name>");
break;
}
SaveLayout(args[1], &D_canvas);
@@ -4338,7 +4353,7 @@ int key;
lay = layouts;
if (!lay)
{
- Msg(0, "no layout defined");
+ OutputMsg(0, "no layout defined");
break;
}
if (lay == D_layout)
@@ -4358,7 +4373,7 @@ int key;
lay = layouts;
if (!lay)
{
- Msg(0, "no layout defined");
+ OutputMsg(0, "no layout defined");
break;
}
if (lay == D_layout)
@@ -4371,11 +4386,11 @@ int key;
if (!args[1])
{
if (!layout_attach)
- Msg(0, "no attach layout set");
+ OutputMsg(0, "no attach layout set");
else if (layout_attach == &layout_last_marker)
- Msg(0, "will attach to last layout");
+ OutputMsg(0, "will attach to last layout");
else
- Msg(0, "will attach to layout %d (%s)", layout_attach->lay_number, layout_attach->lay_title);
+ OutputMsg(0, "will attach to layout %d (%s)", layout_attach->lay_number, layout_attach->lay_title);
break;
}
if (!strcmp(args[1], ":last"))
@@ -4388,7 +4403,7 @@ int key;
lay = FindLayout(args[1]);
if (!lay)
{
- Msg(0, "unknown layout '%s'", args[1]);
+ OutputMsg(0, "unknown layout '%s'", args[1]);
break;
}
layout_attach = lay;
@@ -4406,7 +4421,7 @@ int key;
lay = layouts ? FindLayout(args[1]) : (struct layout *)0;
if (!lay)
{
- Msg(0, "unknown layout '%s'", args[1]);
+ OutputMsg(0, "unknown layout '%s'", args[1]);
break;
}
}
@@ -4416,21 +4431,21 @@ int key;
else if (!strcmp(args[0], "dump"))
{
if (!display)
- Msg(0, "Must have a display for 'layout dump'.");
+ OutputMsg(0, "Must have a display for 'layout dump'.");
else if (!LayoutDumpCanvas(&D_canvas, args[1] ? args[1] : "layout-dump"))
- Msg(errno, "Error dumping layout.");
+ OutputMsg(errno, "Error dumping layout.");
else
- Msg(0, "Layout dumped to \"%s\"", args[1] ? args[1] : "layout-dump");
+ OutputMsg(0, "Layout dumped to \"%s\"", args[1] ? args[1] : "layout-dump");
}
else
- Msg(0, "unknown layout subcommand");
+ OutputMsg(0, "unknown layout subcommand");
break;
#ifdef DW_CHARS
case RC_CJKWIDTH:
if(ParseSwitch(act, &cjkwidth) == 0)
{
if(msgok)
- Msg(0, "Treat ambiguous width characters as %s width", cjkwidth ? "full" : "half");
+ OutputMsg(0, "Treat ambiguous width characters as %s width", cjkwidth ? "full" : "half");
}
break;
#endif
@@ -4448,6 +4463,7 @@ int key;
break;
}
}
+#undef OutputMsg
void
DoCommand(argv, argl)
@@ -4458,6 +4474,9 @@ int *argl;
const char *cmd = *argv;
act.quiet = 0;
+ /* For now, we actually treat both 'supress error' and 'suppress normal message' as the
+ * same, and ignore all messages on either flag. If we wanted to do otherwise, we would
+ * need to change the definition of 'OutputMsg' slightly. */
if (*cmd == '@') /* Suppress error */
{
act.quiet |= 0x01;
@@ -4623,7 +4642,7 @@ int bufl, *argl;
else if (delim != '\'' && *p == '$' && (p[1] == '{' || p[1] == ':' || (p[1] >= 'a' && p[1] <= 'z') || (p[1] >= 'A' && p[1] <= 'Z') || (p[1] >= '0' && p[1] <= '9') || p[1] == '_'))
{
- char *ps, *pe, op, *v, xbuf[11];
+ char *ps, *pe, op, *v, xbuf[11], path[MAXPATHLEN];
int vl;
ps = ++p;
@@ -4667,6 +4686,13 @@ int bufl, *argl;
sprintf(xbuf, "%d", display ? D_height : -1);
else if (!strcmp(ps, "PID"))
sprintf(xbuf, "%d", getpid());
+ else if (!strcmp(ps, "PWD"))
+ {
+ if (getcwd(path, sizeof(path) - 1) == 0)
+ v = "?";
+ else
+ v = path;
+ }
else if (!strcmp(ps, "STY"))
{
if ((v = strchr(SockName, '.'))) /* Skip the PID */
@@ -5357,6 +5383,8 @@ int where;
rend = renditions[REND_MONITOR];
else if ((p->w_bell == BELL_DONE || p->w_bell == BELL_FOUND) && renditions[REND_BELL] != -1)
rend = renditions[REND_BELL];
+ else if ((p->w_silence == SILENCE_FOUND || p->w_silence == SILENCE_DONE) && renditions[REND_SILENCE] != -1)
+ rend = renditions[REND_SILENCE];
}
if (rend != -1)
AddWinMsgRend(s, rend);
diff --git a/src/resize.c b/src/resize.c
index ba70482..d025730 100644
--- a/src/resize.c
+++ b/src/resize.c
@@ -370,8 +370,7 @@ struct display *norefdisp;
/* If 'flayer' and 'l' are for the same window, then we will not
* restore 'flayer'. */
if (oldflayer && (l == oldflayer || Layer2Window(oldflayer) == p))
- while (oldflayer->l_next)
- oldflayer = oldflayer->l_next;
+ oldflayer = NULL;
flayer = l;
@@ -414,7 +413,7 @@ struct display *norefdisp;
/* If we started resizing a non-flayer layer, then restore the flayer.
* Otherwise, flayer should already be updated to the topmost foreground layer. */
- if (Layer2Window(flayer) != Layer2Window(oldflayer))
+ if (oldflayer)
flayer = oldflayer;
display = olddisplay;
}
diff --git a/src/screen.c b/src/screen.c
index 2a905a8..3dde3b4 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -2075,33 +2075,37 @@ MakeNewEnv()
*np = 0;
}
-void
-/*VARARGS2*/
#if defined(USEVARARGS) && defined(__STDC__)
-Msg(int err, const char *fmt, VA_DOTS)
+ #define DEFINE_VARARGS_FN(fnname) void fnname (int err, const char *fmt, VA_DOTS)
#else
-Msg(err, fmt, VA_DOTS)
-int err;
-const char *fmt;
-VA_DECL
-#endif
+ #define DEFINE_VARARGS_FN(fnname) void fnname(err, fmt, VA_DOTS) \
+ int err; \
+ const char *fmt; \
+ VA_DECL
+#endif
+
+#define PROCESS_MESSAGE(B) do { \
+ char *p = B; \
+ VA_LIST(ap) \
+ VA_START(ap, fmt); \
+ fmt = DoNLS(fmt); \
+ (void)vsnprintf(p, sizeof(B) - 100, fmt, VA_ARGS(ap)); \
+ VA_END(ap); \
+ if (err) \
+ { \
+ p += strlen(p); \
+ *p++ = ':'; \
+ *p++ = ' '; \
+ strncpy(p, strerror(err), B + sizeof(B) - p - 1); \
+ B[sizeof(B) - 1] = 0; \
+ } \
+ } while (0)
+
+DEFINE_VARARGS_FN(Msg)
{
- VA_LIST(ap)
char buf[MAXPATHLEN*2];
- char *p = buf;
+ PROCESS_MESSAGE(buf);
- VA_START(ap, fmt);
- fmt = DoNLS(fmt);
- (void)vsnprintf(p, sizeof(buf) - 100, fmt, VA_ARGS(ap));
- VA_END(ap);
- if (err)
- {
- p += strlen(p);
- *p++ = ':';
- *p++ = ' ';
- strncpy(p, strerror(err), buf + sizeof(buf) - p - 1);
- buf[sizeof(buf) - 1] = 0;
- }
debug2("Msg('%s') (%#x);\n", buf, (unsigned int)display);
if (display && displays)
@@ -2132,33 +2136,11 @@ VA_DECL
/*
* Call FinitTerm for all displays, write a message to each and call eexit();
*/
-void
-/*VARARGS2*/
-#if defined(USEVARARGS) && defined(__STDC__)
-Panic(int err, const char *fmt, VA_DOTS)
-#else
-Panic(err, fmt, VA_DOTS)
-int err;
-const char *fmt;
-VA_DECL
-#endif
+DEFINE_VARARGS_FN(Panic)
{
- VA_LIST(ap)
char buf[MAXPATHLEN*2];
- char *p = buf;
+ PROCESS_MESSAGE(buf);
- VA_START(ap, fmt);
- fmt = DoNLS(fmt);
- (void)vsnprintf(p, sizeof(buf) - 100, fmt, VA_ARGS(ap));
- VA_END(ap);
- if (err)
- {
- p += strlen(p);
- *p++ = ':';
- *p++ = ' ';
- strncpy(p, strerror(err), buf + sizeof(buf) - p - 1);
- buf[sizeof(buf) - 1] = 0;
- }
debug3("Panic('%s'); display=%x displays=%x\n", buf, display, displays);
if (displays == 0 && display == 0)
{
@@ -2211,6 +2193,22 @@ VA_DECL
eexit(1);
}
+DEFINE_VARARGS_FN(QueryMsg)
+{
+ char buf[MAXPATHLEN*2];
+
+ if (queryflag < 0)
+ return;
+
+ PROCESS_MESSAGE(buf);
+ write(queryflag, buf, strlen(buf));
+}
+
+DEFINE_VARARGS_FN(Dummy)
+{}
+
+#undef PROCESS_MESSAGE
+#undef DEFINE_VARARGS_FN
/*
* '^' is allowed as an escape mechanism for control characters. jw.
@@ -3241,6 +3239,15 @@ char *data;
}
WindowChanged(p, 'f');
}
+ if (p->w_silence == SILENCE_FOUND)
+ {
+ /* Unset the flag if the user switched to this window. */
+ if (p->w_layer.l_cvlist)
+ {
+ p->w_silence = SILENCE_ON;
+ WindowChanged(p, 'f');
+ }
+ }
}
for (display = displays; display; display = display->d_next)
diff --git a/src/screen.h b/src/screen.h
index a24c021..5c93f32 100644
--- a/src/screen.h
+++ b/src/screen.h
@@ -256,7 +256,7 @@ struct msg
#define VBELLWAIT 1 /* No. of seconds a vbell will be displayed */
#define BELL_ON 0 /* No bell has occurred in the window */
-#define BELL_FOUND 1 /* A bell has occurred, but user not yet notified */
+#define BELL_FOUND 1 /* A bell has occurred, but user not yet notified */
#define BELL_DONE 2 /* A bell has occured, user has been notified */
#define BELL_VISUAL 3 /* A bell has occured in fore win, notify him visually */
@@ -271,8 +271,10 @@ struct msg
#define DUMP_EXCHANGE 2
#define DUMP_SCROLLBACK 3
-#define SILENCE_OFF 0
-#define SILENCE_ON 1
+#define SILENCE_OFF 0 /* Not checking for silence */
+#define SILENCE_ON 1 /* Window being monitored for silence */
+#define SILENCE_FOUND 2 /* Window is silent */
+#define SILENCE_DONE 3 /* Window is silent and user is notified */
extern char strnomem[];
diff --git a/src/socket.c b/src/socket.c
index 9dbf461..940034d 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -1622,6 +1622,30 @@ int ilen;
}
#endif
+/* 'end' is exclusive, i.e. you should *not* write in *end */
+static char *
+strncpy_escape_quote(dst, src, end)
+char *dst;
+const char *src, *end;
+{
+ while (*src && dst < end)
+ {
+ if (*src == '"')
+ {
+ if (dst + 2 < end) /* \\ \" \0 */
+ *dst++ = '\\';
+ else
+ return NULL;
+ }
+ *dst++ = *src++;
+ }
+ if (dst >= end)
+ return NULL;
+
+ *dst = '\0';
+ return dst;
+}
+
static void
DoCommandMsg(mp)
struct msg *mp;
@@ -1645,9 +1669,15 @@ struct msg *mp;
for (fc = fullcmd; n > 0; n--)
{
int len = strlen(p);
- strncpy(fc, p, fullcmd + sizeof(fullcmd) - fc - 1);
+ *fc++ = '"';
+ if (!(fc = strncpy_escape_quote(fc, p, fullcmd + sizeof(fullcmd) - 2))) /* '"' ' ' */
+ {
+ Msg(0, "Remote command too long.");
+ queryflag = -1;
+ return;
+ }
p += len + 1;
- fc += len;
+ *fc++ = '"';
*fc++ = ' ';
}
if (fc != fullcmd)
diff --git a/src/window.c b/src/window.c
index 2ad3615..6916eca 100644
--- a/src/window.c
+++ b/src/window.c
@@ -2070,6 +2070,8 @@ char *data;
continue;
#endif
Msg(0, "Window %d: silence for %d seconds", p->w_number, p->w_silencewait);
+ p->w_silence = SILENCE_FOUND;
+ WindowChanged(p, 'f');
}
}
diff --git a/src/window.h b/src/window.h
index 6bd8e2d..47f5c9e 100644
--- a/src/window.h
+++ b/src/window.h
@@ -133,7 +133,7 @@ struct paster
struct paster;
#endif
-struct win
+struct win
{
struct win *w_next; /* next window */
int w_type; /* type of window */
@@ -187,7 +187,7 @@ struct win
int w_CharsetR; /* charset number GR */
int w_charsets[4]; /* Font = charsets[Charset] */
#endif
- int w_ss;
+ int w_ss;
int w_saved;
int w_Saved_x, w_Saved_y;
struct mchar w_SavedRend;
@@ -227,7 +227,7 @@ struct win
int w_monitor; /* monitor status */
int w_silencewait; /* wait for silencewait secs */
int w_silence; /* silence status (Lloyd Zusman) */
- char w_vbwait;
+ char w_vbwait;
char w_norefresh; /* dont redisplay when switching to that win */
#ifdef RXVT_OSC
char w_xtermosc[4][MAXSTR]; /* special xterm/rxvt escapes */
@@ -246,8 +246,8 @@ struct win
#else
int w_histheight; /* always 0 */
#endif
- int w_pid; /* process at the other end of ptyfd */
- int w_deadpid; /* saved w_pid of a process that closed the ptyfd to us */
+ int w_pid; /* process at the other end of ptyfd */
+ int w_deadpid; /* saved w_pid of a process that closed the ptyfd to us */
char *w_cmdargs[MAXARGS]; /* command line argument vector */
char *w_dir; /* directory for chdir */