فهرست منبع

make sessionname detection more robust

The original code from the webpage, detecting all non-whitespace is still the
best way of extracting the session name from `screen -ls`.
Weiyi Lou 13 سال پیش
والد
کامیت
da64aa0b5f
1فایلهای تغییر یافته به همراه3 افزوده شده و 1 حذف شده
  1. 3 1
      screen/screenrc

+ 3 - 1
screen/screenrc

@@ -159,6 +159,8 @@ msgwait               15
 #
 # Commands to call using the %` substitutions (e.g. in hardstatus line)
 # Potentially Very Powerful!
+# Note that any commands in backtick are expected to return only ONE line of
+# output (no idea what happens if there's more than that).
 #
 # Syntax:
 #     backtick id lifespan autorefresh command [args...]
@@ -175,7 +177,7 @@ msgwait               15
 # get the sessionname that has been set by `C-a :sessionname` or by
 # `screen -S [name]`
 #
-backtick 1 30 30 sh -c 'screen -ls | grep --color=no -o "$PPID.[A-Za-z0-9]*" | sed s/$PPID.//'
+backtick 1 30 30 sh -c 'screen -ls | grep --color=no -o "$PPID\.[^[:space:]]*" | sed s/$PPID\.//'
 
 
 ##################################