joshmedeski / sesh

Smart session manager for the terminal
MIT License
534 stars 30 forks source link

Paths with an ending bracket [] fail to list #135

Closed GravityShark0 closed 1 week ago

GravityShark0 commented 1 month ago

What happened?

When I use sesh list, I expected paths that have ending brackets to be listed properly but they are trimmed off their brackets and could no longer be connected to!

Deleting the line that does trimming seems to fix the issue, although I do not know the original purpose of the trimming.

https://github.com/joshmedeski/sesh/blob/3bbb3d21e1cc971715b5599226a373f02d82783b/zoxide/query.go#L24

https://github.com/joshmedeski/sesh/blob/3bbb3d21e1cc971715b5599226a373f02d82783b/zoxide/list.go#L31

Recreation

  1. Create a path with a right or left bracket
    cd ~/
    mkdir "leftbracket["
    mkdir "rightbracket]"
  2. Add paths to zoxide
    
    zoxide add "leftbracket["
    zoxide add "rightbracket["
3. List paths
```sh
sesh list | grep ".*bracket"
# ~/leftbracket
# ~/rightbracket
# missing the bracket
  1. Try to connect from sesh list output
    sesh connect ~/leftbracket
    2024/07/19 12:31:39 unable to connect to "~/leftbracket": failed to add "/home/gravity/leftbracket" to zoxide: exit status 1
    sesh connect ~/rightbracket
    2024/07/19 12:32:11 unable to connect to "~/rightbracket": failed to add "/home/gravity/rightbracket" to zoxide: exit status 1

    explicitly adding the bracket works

    sesh connect ~/leftbracket\[ # works
    sesh connect ~/rightbracket] # works

Version

dev

Relevant log output

2024/07/19 12:31:39 unable to connect to "~/leftbracket": failed to add "/home/gravity/leftbracket" to zoxide: exit status 1
2024/07/19 12:32:11 unable to connect to "~/rightbracket": failed to add "/home/gravity/rightbracket" to zoxide: exit status 1

Reviewed

joshmedeski commented 1 month ago

I can confirm that this is fixed with v2! I'm not quite feature complete yet but I'm hoping to get it shipped in August!

joshmedeski commented 2 weeks ago

Can you upgrade and test if this works with Sesh v2?

GravityShark0 commented 1 week ago

Apologizes for the late reply, it seems to be working when using the binary from Github releases (v2.0.2). However I first tried to install sesh from go install github.com/joshmedeski/sesh@latest which is what I usually use, and it didn't work. I do not know how go install works but this seems to be slightly important issue because its listed as one of the 3 main ways to install sesh in the README.

I'm closing the issue as brackets work properly from my testing.

joshmedeski commented 1 week ago

I had to run the following command before installing sesh vis go install

go clean -modcache