joshmedeski / sesh

Smart session manager for the terminal
MIT License
410 stars 16 forks source link

custom sessions with duplicate paths in sesh.toml not listed #124

Open kristoferfannar opened 3 weeks ago

kristoferfannar commented 3 weeks ago

What happened?

To preface, I'm new here. Just found sesh a few days ago and started configuring today. I have this custom session listed in my sesh.toml

[[session]]
name = "nvim config"
path = "~/.config/nvim"
startup_command = "nvim ."

[[session]]
name = "tmux config"
path = "~"
startup_command = "nvim .tmux.conf"

But running sesh list, I only get the nvim config:

❯ sesh list
sesh
...
nvim config

I've found that the reason for this is the path I'm specifying for the tmux config session, ~. From a quick debugging session in the code, sesh decides not to add it as an option since I already have a session connected to this directory already. Specifically, listConfigSessions in session/list.go seems to handle this filtering.

I understand the reasoning for the implementation, especially to avoid including zoxide directories as possible session options if there already exists a session for that dir. However, I think that custom sessions in sesh.toml should always appear from calling sesh list, no matter their path.

I'll try my hand at a solution in a PR and will link this issue there. Otherwise, I'll lookout for your comment on this.

Version

1.2.0

Relevant log output

No response

Reviewed

joshmedeski commented 2 weeks ago

I understand the issue, It is already fixed in my #99 work, but it is not yet merged.

EvanEzell commented 6 days ago

Any idea on when this will be merged? I am running into the same issue

joshmedeski commented 6 days ago

There is a PR by @kristoferfannar that fixes this specific issue. I'll work to get it merged in the next week!