bugGNU Screen - Bugs: bug #27950, provide the current process id to...

 
 

bug #27950: provide the current process id to .screenrc

Submitted by:  None
Submitted on:  Thu 05 Nov 2009 04:21:57 PM UTC  
 
Category: Feature RequestSeverity: 3 - Normal
Priority: 5 - NormalStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: ClosedRelease: Cur Dev Sources
Fixed Release: 4.1.0Planned Release: None
Work Required: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 13 Dec 2011 08:45:54 PM UTC, comment #2:

<a href="http://www.workonlineathome.co.uk">make money online</a>

-Deleted Account- <leesteve1981>
Wed 11 Nov 2009 04:18:20 PM UTC, comment #1:

Patch accepted.

Sadrul Habib Chowdhury <sadrul>
Project Administrator
Thu 05 Nov 2009 04:21:57 PM UTC, original submission:

It would be extremely useful to have the current SCREEN process id available during .screenrc evaluation, so that environment variables can be set differently per-process.

In particular, this would allow you to run a per-screen SSH agent:
setenv SSH_AUTH_SOCK $HOME/.screen-ssh-agent.$PID
screen 10 ssh-agent -a $SSH_AUTH_SOCK $SHELL

The patch is simple:
diff --git a/src/process.c b/src/process.c
index b0ee23d..fabb550 100644
--- a/src/process.c
+++ b/src/process.c
@@ -4078,6 +4078,8 @@ int bufl, *argl;
sprintf(xbuf, "%d", display ? D_width : -1);
else if (!strcmp(ps, "LINES"))
sprintf(xbuf, "%d", display ? D_height : -1);
+ else if (!strcmp(ps, "PID"))
+ sprintf(xbuf, "%d", getpid());
else
v = getenv(ps);
}

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by leesteve1981 (Posted a comment)
  • -unavailable- added by sadrul (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 11 Nov 2009 04:18:20 PM UTCsadrulStatusNone=>Fixed
      Open/ClosedOpen=>Closed
      Fixed ReleaseNone=>4.1.0

    Back to the top


    Powered by Savane 3.1-cleanup1