forked from pool/screen
Thomas Renninger
a13ce2fdf3
screen-poll-zombies.patch: Dead windows will be restarted after a specified timeout (if enabled) screen_enhance_windows_list_1_3.patch: Cleanup window flags processing. This leads to a slight output change in "Ww" string escapes (window list), but these should be rather seldom used and flags are still shown. screen_enhance_windows_list_2_3.patch: Enhance windows command with an optional string escape based parameter which also removes the output size (1024 bytes) restriction (only if param is passed) of the windows command. - Only Require makeinfo for openSUSE versions 11.4 and above. This requirement did not exist in earlier versions, now the package builds again for example against SLES 11 (11.4 based). OBS-URL: https://build.opensuse.org/package/show/Base:System/screen?expand=0&rev=41
141 lines
4.2 KiB
Diff
141 lines
4.2 KiB
Diff
screen: Introduce windows command
|
|
|
|
This new command is doing nearly the same as the windows
|
|
command.
|
|
But a string escape can be passed which makes it much
|
|
more flexible. The default string escape if no argument
|
|
is passed is "%n%f %t " which is intended to rebuild
|
|
the same output the windows command would give as good
|
|
as possible (slight changes with the flags can happen).
|
|
|
|
This command is also not be limited in output size
|
|
(the windows command is limited to 1024 bytes).
|
|
|
|
The windowsx command can be queried (-Q command) and
|
|
this is its main purpose (be able to query the exact
|
|
window list status of an active screen session from
|
|
shell).
|
|
|
|
Signed-off-by: Thomas Renninger <trenn@suse.de>
|
|
---
|
|
src/comm.c | 2 +-
|
|
src/doc/screen.1 | 5 ++++-
|
|
src/doc/screen.texinfo | 7 ++++++-
|
|
src/process.c | 35 ++++++++++++++++++++++++++++++++++-
|
|
4 files changed, 45 insertions(+), 4 deletions(-)
|
|
|
|
diff --git a/comm.c b/comm.c
|
|
index 8722ca8..b8b535f 100644
|
|
--- a/comm.c
|
|
+++ b/comm.c
|
|
@@ -328,7 +328,7 @@ struct comm comms[RC_LAST + 1] =
|
|
{ "wall", NEED_DISPLAY|ARGS_1},
|
|
{ "width", ARGS_0123 },
|
|
{ "windowlist", ARGS_012 },
|
|
- { "windows", CAN_QUERY|ARGS_0 },
|
|
+ { "windows", CAN_QUERY|ARGS_01 },
|
|
{ "wrap", NEED_FORE|ARGS_01 },
|
|
#ifdef COPY_PASTE
|
|
{ "writebuf", ARGS_0123 },
|
|
diff --git a/doc/screen.1 b/doc/screen.1
|
|
index 4e72f8b..7a0c1de 100644
|
|
--- a/doc/screen.1
|
|
+++ b/doc/screen.1
|
|
@@ -3430,7 +3430,7 @@ settings).
|
|
and 6 characters high in order to display.
|
|
.sp
|
|
.ne 3
|
|
-.B windows
|
|
+.B windows [ string ]
|
|
.PP
|
|
Uses the message line to display a list of all the windows.
|
|
Each window is listed by number with the name of process that has been
|
|
@@ -3446,6 +3446,9 @@ windows occupied by other users are marked with `&';
|
|
windows in the zombie state are marked with `Z'.
|
|
If this list is too long to fit on the terminal's status line only the
|
|
portion around the current window is displayed.
|
|
+The optional string parameter follows the \*QSTRING ESCAPES\*U format.
|
|
+If string parameter is passed, the output size is unlimited.
|
|
+The default command without any parameter is limited to a size of 1024 bytes.
|
|
.sp
|
|
.ne 3
|
|
.BR "wrap " [ on | off ]
|
|
diff --git a/doc/screen.texinfo b/doc/screen.texinfo
|
|
index e564abe..e7a693d 100644
|
|
--- a/doc/screen.texinfo
|
|
+++ b/doc/screen.texinfo
|
|
@@ -2613,7 +2613,7 @@ before displaying a message. Default is 30 seconds.
|
|
@section Windows
|
|
@kindex w
|
|
@kindex C-w
|
|
-@deffn Command windows
|
|
+@deffn Command windows [string]
|
|
(@kbd{C-a w}, @kbd{C-a C-w})@*
|
|
Uses the message line to display a list of all the windows. Each
|
|
window is listed by number with the name of the program running in the
|
|
@@ -2632,6 +2632,11 @@ windows in the zombie state are marked with @samp{Z}.
|
|
|
|
If this list is too long to fit on the terminal's status line only the
|
|
portion around the current window is displayed.
|
|
+
|
|
+You can customize the output format to any string you like including
|
|
+string escapes (@pxref{String Escapes}).
|
|
+In this case, if the string parameter is passed, the maximum output
|
|
+size is unlimited (instead of 1024 bytes if no parameter is passed).
|
|
@end deffn
|
|
|
|
@node Hardstatus, Mousetrack, Windows, Window Settings
|
|
diff --git a/process.c b/process.c
|
|
index 7370924..79e82b5 100644
|
|
--- a/process.c
|
|
+++ b/process.c
|
|
@@ -1838,7 +1838,12 @@ int key;
|
|
Activate(-1);
|
|
break;
|
|
case RC_WINDOWS:
|
|
- ShowWindows(-1);
|
|
+ if (args[0]) {
|
|
+ s = SaveStr(args[0]);
|
|
+ ShowWindowsX(s);
|
|
+ }
|
|
+ else
|
|
+ ShowWindows(-1);
|
|
break;
|
|
case RC_VERSION:
|
|
OutputMsg(0, "screen %s", version);
|
|
@@ -5605,6 +5610,34 @@ struct win *p;
|
|
return s;
|
|
}
|
|
|
|
+/*
|
|
+ * String Escape based windows listing
|
|
+ * Unfortunately it is not possible to rebuild the exact
|
|
+ * output (flags) from ShowWindows() with a default
|
|
+ * string escape. But when there should be a new screen
|
|
+ * version where slight output changes get accepted,
|
|
+ * ShowWindowsX() should replace the rather static
|
|
+ * (in output and size) old ShowWindows() and AddWindows()
|
|
+ * functions
|
|
+ */
|
|
+void
|
|
+ShowWindowsX(char *string)
|
|
+{
|
|
+ int i;
|
|
+ char *s = "";
|
|
+
|
|
+ debug1("ShowWindowsX: string [%s]", string);
|
|
+
|
|
+ for (i = 0; i < maxwin ; i++)
|
|
+ {
|
|
+ if (wtab[i] == NULL)
|
|
+ continue;
|
|
+
|
|
+ s = MakeWinMsg(string, wtab[i], '%');
|
|
+ Msg(0, "%s", s);
|
|
+ }
|
|
+}
|
|
+
|
|
void
|
|
ShowWindows(where)
|
|
int where;
|