joshmedeski / sesh

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

Unable to connect to relative path sessions made w/o zoxide #133

Closed GravityShark0 closed 1 week ago

GravityShark0 commented 1 month ago

What happened?

Recreation

  1. Restart to default state without zoxide
    # Restart to default state
    pkill sesh
    pkill tmux
    # Reset zoxide
    zoxide remove ~/foo
    zoxide remove ~/bar
    # Delete paths
    rmdir ~/foo
    rmdir ~/bar
    # Create paths
    mkdir ~/foo
    mkdir ~/bar
  2. Create session
    cd ~/
    # connects to foo via relative path and detaches creating a new session
    sesh connect --command "tmux detach" foo # or ./foo/
  3. Try to connect to session from a different path
    cd ~/bar
    # (sesh list | head -n 1) should output = foo or _/foo/
    sesh connect $(sesh list | head -n 1) # exit status 1, see relevant log output

Notes

Version

dev and 1.2.0

Relevant log output

2024/07/19 10:06:56 unable to connect to "foo": failed to add "/home/gravity/bar/foo" to zoxide: exit status 1

Reviewed

GravityShark0 commented 1 month ago

I have made a fork with a hack that sort of works so far in here. I don't expect it to be merged or anything since it seems v2 is a complete rewrite, but I would like to see it fixed in there so I thought of making an issue.

joshmedeski commented 1 month ago

Hey, I do intend on v2 of Sesh being able to handle relative paths, thanks for the flagging this.

joshmedeski commented 2 weeks ago

Can you upgrade and test this and tell me if it's working with Sesh v2?

GravityShark0 commented 1 week ago

I have upgraded and yes this now works in Sesh v2 from what I've tested.

By the way, I have commented on the previous issue about hiding to already attached sessions session (https://github.com/joshmedeski/sesh/issues/50#issuecomment-2330724158), because --hide-attached no longer seems to have any effect in Sesh v2 but still is acceptable as an argument. I don't know if I should create a new issue about this or reopen the previous one. But I am closing this one as it seems fine so far.