Fix screen session name completion for non-Ubuntu distros

For some reason Ubuntu's version of screen includes timestamps in the
output of `screen -list`. The timestamps aren't present on other
distributions (tested on Fedora and Arch Linux), nor when building from
source. This commit fixes the regex so that with or without the
timestamp, fish will correctly show suggestions for screen sessions.
This commit is contained in:
Collin Styles 2019-02-18 22:27:10 -08:00 committed by ridiculousfish
parent efa88b171a
commit e475b1a375

View File

@ -21,7 +21,7 @@ end
function __fish_complete_screen_general_list -d "Get the socket list"
set -l escaped (string escape --style=regex $argv)
screen -list | string match -r '^\t.*\(.*\)\s*\('$escaped'\)\s*$'| string replace -r '\t(.*)\s+\((.*)\)\s*\((.*)\)' '$1\t$2 $3'
screen -list | string match -r '^\t.*\('$escaped'\)\s*$' | string replace -r '\t(.*)\s+(\(.*\))?\s*\((.*)\)' '$1\t$3'
end
function __fish_complete_screen_detached -d "Print a list of detached screen sessions"