We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9eb04dc commit bb3b83fCopy full SHA for bb3b83f
zoxide/list.go
@@ -18,12 +18,16 @@ type ZoxideResult struct {
18
func List(tmuxSessions []*tmux.TmuxSession) ([]*ZoxideResult, error) {
19
output, err := zoxideCmd([]string{"query", "-ls"})
20
if err != nil {
21
- return nil, err
+ return []*ZoxideResult{}, nil
22
}
23
cleanOutput := strings.TrimSpace(string(output))
24
list := strings.Split(cleanOutput, "\n")
25
+ listLen := len(list)
26
+ if listLen == 1 && list[0] == "" {
27
28
+ }
29
- results := make([]*ZoxideResult, 0, len(list))
30
+ results := make([]*ZoxideResult, 0, listLen)
31
tmuxSessionPaths := make(map[string]struct{})
32
for _, session := range tmuxSessions {
33
tmuxSessionPaths[session.Path] = struct{}{}
0 commit comments