diff options
author | Alexander Naumov <posix.ru@gmail.com> | 2015-05-27 08:51:27 +0200 |
---|---|---|
committer | Alexander Naumov <posix.ru@gmail.com> | 2015-05-27 08:51:27 +0200 |
commit | 7b72e98fc368e7facda37a1569d7aa0a85feafff (patch) | |
tree | 5bd224ed57c7fbe75407082f69d660af39a58372 | |
parent | f380de406c9542382ba8074fcdd44bd042f84865 (diff) | |
download | screen-7b72e98fc368e7facda37a1569d7aa0a85feafff.tar.gz |
screen: Introduce Xx string escape showing the executed command of a window
either only the executed command ('X') or the whole command line ('x') of
each window is shown.
Signed-off-by: Alexander Naumov <posix.ru@gmail.com>
Signed-off-by: Thomas Renninger <trenn@suse.de>
-rw-r--r-- | src/doc/screen.1 | 4 | ||||
-rw-r--r-- | src/screen.c | 14 |
2 files changed, 18 insertions, 0 deletions
diff --git a/src/doc/screen.1 b/src/doc/screen.1 index fd5c06e..366ba40 100644 --- a/src/doc/screen.1 +++ b/src/doc/screen.1 @@ -3738,6 +3738,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 426fbda..deeafa1 100644 --- a/src/screen.c +++ b/src/screen.c @@ -2688,6 +2688,20 @@ int rec; } p += strlen(p) - 1; break; + case 'X': case 'x': + *p = 0; + for (i = 0; win && win->w_cmdargs[i]; i++) + { + if (l < strlen(win->w_cmdargs[i]) + 1) + break; + sprintf(p, i ? "%s" : " %s", win->w_cmdargs[i]); + l -= strlen(p); + p += strlen(p); + if (i == 0 && *s == 'X') + break; + } + p--; + break; case 'l': #ifdef LOADAV *p = 0; |