ervandew / screen

Simulate a split shell in vim using gnu screen or tmux
202 stars 31 forks source link

:ScreenShellAttach doesn't work with screen version 4.00.03jw4 #3

Closed benwbooth closed 13 years ago

benwbooth commented 13 years ago

I'm using screen.vim 1.1, with screen version 4.00.03jw4.

when I try to use :ScreenShellAttach and use tab to autocomplete the list of existing shells, I'm not able to attach to the autocompleted shell. I tracked down the problem to the GetScreenSessions function. The regular expression doesn't work with the output of screen -wipe:

$ screen -wipe There is a screen on: 6567.slime (09/23/2010 09:05:33 AM) (Attached) 1 Socket in /var/run/screen/S-bbooth.

I loosened up the regular expressions to be this:

function! s:GetScreenSessions()
  let results = split(system('screen -wipe'), "\n")
  call filter(results, 'v:val =~ "(\\w\\+)"')
  call map(results, '[' .
    \ 'substitute(v:val, "^\\s*\\(\\S*\\).*", "\\1", ""), ' .
    \ 'tolower(substitute(v:val, "(\\(\\w\\+\\))$", "\\1", ""))]')
  return results
 endfunction " }}}

This fixes the problem.

ervandew commented 13 years ago

The change looks good, so I'll commit it later today.

Thanks for the patch :)

ervandew commented 13 years ago

update GetScreenSessions for newer listing formats

closed by 25c3846e169a743cd11c1e0fa3b7bf3bdc875a98