screen-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[screen-devel] [PATCH 3/3] screen: Introduce Xx string escape showing th


From: Thomas Renninger
Subject: [screen-devel] [PATCH 3/3] screen: Introduce Xx string escape showing the executed command of a window
Date: Tue, 12 Feb 2013 00:07:55 +0100

either only the executed command ('X') or the whole command line ('x') of
each window is shown.

Signed-off-by: Thomas Renninger <address@hidden>
Signed-off-by: Thomas Renninger <Thomas Renninger" address@hidden>
---
 src/doc/screen.1 |    4 ++++
 src/screen.c     |   17 +++++++++++++++++
 2 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/src/doc/screen.1 b/src/doc/screen.1
index 7a0c1de..57352f1 100644
--- a/src/doc/screen.1
+++ b/src/doc/screen.1
@@ -3750,6 +3750,10 @@ window; with '+' qualifier: starting with the window 
after the current
 one.
 .IP W
 all window numbers and names except the current one
+.IP x
+the executed command including arguments running in this windows
+.IP X
+the executed command without arguments running in this windows
 .IP y
 last two digits of the year number
 .IP Y
diff --git a/src/screen.c b/src/screen.c
index efb73d3..e8a553c 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -2681,6 +2681,23 @@ int rec;
            }
          p += strlen(p) - 1;
          break;
+       case 'X': case 'x':
+         if (!win)
+           break;
+         if (win->w_cmdargs[0]) {
+           sprintf(p, "%s", win->w_cmdargs[0]);
+           p += strlen(p);
+         }
+         else
+           break;
+         if (*s == 'x') {
+           for (i = 1; win->w_cmdargs[i]; i++) {
+             sprintf(p, " %s", win->w_cmdargs[i]);
+             p += strlen(p);
+           }
+         }
+         p--;
+         break;
        case 'l':
 #ifdef LOADAV
          *p = 0;
-- 
1.7.6.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]