9

I'm writing a script which needs the name of the currently attached screen session's name if there's any.

Kenster
  • 23,465
  • 21
  • 80
  • 106
ertan
  • 289
  • 1
  • 3
  • 14
  • see http://stackoverflow.com/questions/2479683/how-do-i-display-the-current-session-name-or-sockname-of-a-screen-session-in – Tamil Selvan C May 31 '13 at 02:44

1 Answers1

19

You might want to check answers here: How do I display the current "session" name or "sockname" of a screen session in the status bar?

In short the $STY environment variable is what you are looking for.

Community
  • 1
  • 1
Martin Mrazik
  • 396
  • 2
  • 3