Connect/go to the previously connected session
Closed this issue · 3 comments
rtalexk commented
What would you like sesh to do?
It would be cool if there's a command or a flag for the connect
command to go to the previous session, just like <prefix>l
in Tmux for the last window, or :e #
to edit the previous buffer in Vim. It would make it easier to navigate between sessions in case you are constantly working with two simultaneous sessions.
joshmedeski commented
This is a built-in feature for tmux:
L Switch the attached client back to the last session.
I use <prefix>+L
all the time :)
rtalexk commented
I didn't know this is already provided by Tmux. For the record, I use M+1, 2, 3, etc to switch for my most used sessions, i.e:
bind-key -n M-1 run-shell "sesh connect <current-project>"
bind-key -n M-1 run-shell "sesh connect <side-project>"
bind-key -n M-3 run-shell "sesh connect <notes>"
bind-key -n M-4 run-shell "sesh connect <configs>"
And I'm usually switching between my notes and a given session, so with @joshmedeski comment above, I added this additional mapping:
bind-key -n M-0 switch-client -l
joshmedeski commented
Great tips!
I use ⌘+l
for "last" session