Search this site


Metadata

Articles

Projects

Presentations

better screen session completion in zsh

function screen-sessions {
   typeset -a sessions
   for i in /tmp/screens/S-${USER}/*(p:t);  do
      sessions+=(${i#*.})
   done

   reply=($sessions)
}

compctl -K screen-sessions screen
Completion chops off the PID of the screen session, so i can do:
screen -x log[TAB]
and it will complete to 'screen -x logwatch'

Hurray.