From 23b17abd7a9f00894f820eeba824623940d26a38 Mon Sep 17 00:00:00 2001 From: Sadrul Habib Chowdhury Date: Thu, 18 Feb 2010 15:20:36 -0500 Subject: Exclude the PID when expanding $STY. Excluding the PID from the expansion of $STY makes it possible to do, e.g. 'source screenrc-$STY' to load session-specific commands. If the PID is desired, for some reason, then '$PID.$STY' should be used instead. --- src/process.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/process.c b/src/process.c index 3ea86cb..e131384 100644 --- a/src/process.c +++ b/src/process.c @@ -4694,7 +4694,12 @@ int bufl, *argl; else if (!strcmp(ps, "PID")) sprintf(xbuf, "%d", getpid()); else if (!strcmp(ps, "STY")) - v = SockName; + { + if ((v = strchr(SockName, '.'))) /* Skip the PID */ + v++; + else + v = SockName; + } else v = getenv(ps); } -- cgit v1.2.1