Never mind

Upon digging, I can see its not an available feature.
 - I've implemented it myself as a %N escape sequence modifier

Perhaps I should move over to the -devel list and see if it can be integrated.

--
Kieran

On 13 October 2011 10:02, Kieran Bingham <kieranbing...@gmail.com> wrote:
> Hi All,
>
> I use screen a lot to keep log files of various tests I perform ...
> As part of this I always have logging enabled, and I 'stop and
> restart' each time to create a new log file
>
> My screenrc has the following lines in it to enable the logging
>
> deflog on
> logdir $HOME/logs
> logfile %Y-%m-%d_%0c.%t.log
>
>
> Now as part of this - I need to keep track of each log file for my
> results - Each time I stop and start the log - i get a brief window of
> opportunity to copy out the new filename - but its brief.
>
> I would like to show the current log file on my status - is this
> possible? I've tried various combinations of escape sequences on
> $LOGNAME based on earlier googling but I wonder if that is the
> LoginName environment shell - not the name of the log file...
>
> I would like to achieve something like:
>
> hardstatus string '%{= kG}[ %{G}%H %{g}][\$LOGNAME][ %=
> %{=kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%=
> %{g}][%{B}%Y-%m-%d %{W}%c %{g}]'
>
>
> Does anyone know if this is possible ?
>
> Cheers
>
> Kieran Bingham
>
From b69f747788070390774e62af0021387c96ba1529 Mon Sep 17 00:00:00 2001
From: Kieran Bingham <kieranbing...@gmail.com>
Date: Thu, 13 Oct 2011 17:16:24 +0100
Subject: [PATCH] Implement Logfile name for the Hard Status Line

---
 src/screen.c |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/src/screen.c b/src/screen.c
index 3dde3b4..a8391cb 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -2829,6 +2829,24 @@ int rec;
 	    p += strlen(p) - 1;
 	  }
 	  break;
+	case 'N':
+	  {
+	    *p = 0;
+
+	    if (D_fore && D_fore->w_log && D_fore->w_log->fp)
+	      {
+		char * logfile_name = D_fore->w_log->name;
+
+		if ((int)strlen(logfile_name) < l)
+		  {
+		    strcpy(p, logfile_name);
+		    if (*p)
+		      qmflag = 1;
+		  }
+	      }
+	    p += strlen(p) - 1;
+	  }
+	  break;
         case 'p':
           {
             sprintf(p, "%d", (plusflg && display) ? D_userpid : getpid());
-- 
1.7.1

_______________________________________________
screen-users mailing list
screen-users@gnu.org
https://lists.gnu.org/mailman/listinfo/screen-users

Reply via email to