On Mon, 11 Mar 2019 16:33:11 -0600
Stan Marsh <gaze...@xmission.com> wrote:

> From within screen, I do:
> 
> $ screen -L cat food
> 
> This pops up a new window (in the current screen session) with an error
> message that food doesn't exist, then exits (see note 1 below). I should
> then have a screenlog.N file on my system containing that error message.
> But there is no such file.
> 
> My understanding from the man page is that -L on the command line is
> supposed to be like doing an immediate ^aH in the window, but it doesn't
> work.  Note that if I do the ^aH in the newly created window, then I will
> get the expected log file.
> 
> Tested originally under:
> 
>     4.02.01 28-Apr-14
> 
> Then re-tested under:
> 
>     4.06.02 23-Oct-17
> 
> with same result.
> 
> Notes:
>     1) Actually, I have "zombie" mode on, so the window stays open and I
>       can see the error message generated.  But the results are the same
>       whether or not zombie mode is on and regardless of what command is
>       used to test (cat food being only used for demonstration purposes).
> 
>     2) I have not tested to see if "-L" works when screen is launched
>       outside of screen.  I.e., if screen is not already running.
> 
>     3) This is actually a bit annoying, since for one of my projects, I
>       really need logging to be on automatically - that is, without my
>       having to do ^aH in the window.
> 
> 

Hi,

from what I can see it's caused by problem with not passing all "new
window" parameters when talking to backend session.

I attached patch, can you check if it works for you? Do note that I
don't plan to merge it at the moment because it will break backward
compatibility and there was already quite a lot of problems when I did
it at the beginning of 4.6 series.

Cheers,
Amadeusz
From ec8313f2093f1ebd82f3d26ad99865899d9daa54 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Amadeusz=20S=C5=82awi=C5=84ski?= <am...@asmblr.net>
Date: Sun, 17 Mar 2019 15:37:05 +0100
Subject: [PATCH] WORKAROUND: fix -L option when passed to backend via Msg
 interface
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Breaks backward compatibility

Signed-off-by: Amadeusz Sławiński <am...@asmblr.net>
---
 src/screen.h | 1 +
 src/socket.c | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/src/screen.h b/src/screen.h
index d39b7eab..ade12d8b 100644
--- a/src/screen.h
+++ b/src/screen.h
@@ -199,6 +199,7 @@ struct msg
       struct
 	{
 	  int lflag;
+	  int Lflag;
 	  int aflag;
 	  int flowflag;
 	  int hheight;		/* size of scrollback buffer */
diff --git a/src/socket.c b/src/socket.c
index ba995bb8..99072c52 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -716,6 +716,7 @@ struct NewWindow *nwin;
   m.m.create.aflag = nwin->aflag;
   m.m.create.flowflag = nwin->flowflag;
   m.m.create.lflag = nwin->lflag;
+  m.m.create.Lflag = nwin->Lflag;
   m.m.create.hheight = nwin->histheight;
   if (getcwd(m.m.create.dir, sizeof(m.m.create.dir)) == 0)
     {
@@ -806,6 +807,7 @@ struct msg *mp;
   if (*mp->m.create.dir)
     nwin.dir = mp->m.create.dir;
   nwin.lflag = mp->m.create.lflag;
+  nwin.Lflag = mp->m.create.Lflag;
   nwin.histheight = mp->m.create.hheight;
   if (*mp->m.create.screenterm)
     nwin.term =  mp->m.create.screenterm;
-- 
2.21.0

Reply via email to