joshmedeski / sesh

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

different session configs with the same path only execute for the first one #97

Open barrydevp opened 2 months ago

barrydevp commented 2 months ago

What happened?

When I config some sessions with the same path directory:

[[session]]
name = "update nvim"
path = "/tmp"
startup_command = "brew upgrade neovim --fetch-HEAD && exit"

[[session]]
name = "update all"
path = "/tmp"
startup_command = "brew update && brew upgrade && exit"

I expected update nvim and update all to run their own session but only update nvim was executed regardless of session!

Version

1.1.0

Relevant log output

No response

Reviewed

barrydevp commented 2 months ago

correct me if I'm wrong, but I think we should return the found session config command here and pass it to connect function. https://github.com/joshmedeski/sesh/blob/fe6e6a65d8cb9dbc2f0ab5abdbe15351c5504d96/session/determine.go#L16C4-L20C5

joshmedeski commented 2 months ago

I am actively reworking the connect logic to handle this situation, thanks for flagging this. The first version of sesh was very much dependent on determining the path first, so this new config pattern breaks that pattern.

I'll be sure to mark this issue closed when I complete the work.