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

 
 

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

Submitter:  None
Submitted:  Thu 05 Nov 2009 04:21:57 PM UTC
   
 
Category:  Feature Request Severity:  3 - Normal
Priority:  * 5 - Normal Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed Release:  Cur Dev Sources
Fixed Release:  4.1.0 Planned Release:  None
Work Required:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

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>
Group 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 Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2009-11-11 sadrul StatusNone Fixed
        Open/ClosedOpen Closed
        Fixed ReleaseNone 4.1.0

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code