File tree Expand file tree Collapse file tree 2 files changed +3
-12
lines changed
Expand file tree Collapse file tree 2 files changed +3
-12
lines changed Original file line number Diff line number Diff line change 11package lister
22
3- import "strings "
3+ import "regexp "
44
55func isBlacklisted (blacklist []string , name string ) bool {
66 for _ , blacklistedName := range blacklist {
7- if strings . EqualFold (blacklistedName , name ) {
7+ if regexp . MustCompile (blacklistedName ). MatchString ( name ) {
88 return true
99 }
1010 }
1111 return false
1212}
13-
14- func createBlacklistSet (blacklist []string ) map [string ]struct {} {
15- blacklistSet := make (map [string ]struct {}, len (blacklist ))
16- for _ , name := range blacklist {
17- blacklistSet [name ] = struct {}{}
18- }
19- return blacklistSet
20- }
Original file line number Diff line number Diff line change @@ -16,12 +16,11 @@ func listTmux(l *RealLister) (model.SeshSessions, error) {
1616 return model.SeshSessions {}, fmt .Errorf ("couldn't list tmux sessions: %q" , err )
1717 }
1818
19- blacklistSet := createBlacklistSet (l .config .Blacklist )
2019 directory := make (map [string ]model.SeshSession )
2120 orderedIndex := []string {}
2221
2322 for _ , session := range tmuxSessions {
24- if _ , blacklisted := blacklistSet [ session .Name ]; ! blacklisted {
23+ if ! isBlacklisted ( l . config . Blacklist , session .Name ) {
2524 key := tmuxKey (session .Name )
2625 orderedIndex = append (orderedIndex , key )
2726 directory [key ] = model.SeshSession {
You can’t perform that action at this time.
0 commit comments