Open kohane27 opened 3 months ago
Hi @kohane27 thanks for the suggestion. I think integrating with tmuxp is possible.
Would you want non-tmuxp commands to still work (ex: listing existing sessions and attaching to current tmux sessions). If so, we'll probably need to adjust your suggestions to better work alongside existing functionality (rather than replacing it).
I've got some ideas but please clarify how you'd expect this to work alongside the current features sesh has to offer.
Thank you for considering this feature request! Initially, I thought it'd be out of project scope but then I saw the feature "clone a git repo and connect to it as a session" so I thought loading a tmux
session would be appropriate enough.
Would you want to list tmux sessions, zoxide results, and tmuxp configs at the same time?
I think this would be best to leave it to the user to implement? What I current use indeed combine zoxide
results and tmuxp
configs:
tmuxp
config (i.e., entries with just the tmuxp
config name), it'd load that session and then switch to it.zoxide
directory (entries starting with ~/
like the top 2 entries above), it'd create a session with that name and then switch to it.Would you want to conditionally load tmuxp configs if the session already exists or there is not config file that matches the result?
Would you want non-tmuxp commands to still work (ex: listing existing sessions and attaching to current tmux sessions).
Thank you for considering these use cases! The following is what I have in mind:
COMMANDS:
list, l List sessions
connect, cn Connect to the given session
load, load Load a given session
Usage:
sesh load "$(sesh list -s | fzf-tmux -p 55%,60%)"
Note: -s
for session
Given there are bind flags like --bind 'ctrl-a:change-prompt(⚡ )+reload(sesh list)'
, it'd be easy enough to switch to other sesh
lists, i.e., switching between sesh list
-s
or -t
or -z
on the fly is convenient enough.
There are many session managers like tmuxp
, most notably tmuxinator:
tmuxinator start [project] -n [name] -p [project-config]
If sesh
supports tmuxinator
then it'd benefit more people. Maybe something similar to the following config?
[[session_path]]
# tmuxp
SESSION_DIR = "~/.config/tmuxp"
SESSION_MANAGER_COMMAND = "tmuxp load -d fzf-result-tmuxp-config-name"
# tmuxinator
SESSION_DIR = "~/.config/tmuxinator"
SESSION_MANAGER_COMMAND = "tmuxinator start --project-config=path/to/fzf/result/project.yaml"
Thank you again!
I'd prefer to keep the connect command as-is, and extend it's functionality.
I think this approach could work:
[[session]]
name = "dotfiles"
path = "~/c/dotfiles"
tmuxp_config = "~/.config/tmuxp/dotfiles.yaml"
We could update the session config over time to offer different options, like tmuxinator as well.
[[session]]
name = "dotfiles"
path = "~/c/dotfiles"
tmuxinator_config = "~/.config/tmuxinator/dotfiles.yaml"
Do you like this approach? Then, sesh connect would be the same, and when you chose a path that matches a config, it would detect the config and run it.
Hello @joshmedeski
Apologies for my late reply.
Thank you for the suggestion:) I think this approach of yours is cleaner!
I'm looking forward to testing when you have time to implement this feature. Thank you again!
What would you like sesh to do?
Hello there! Thank you for creating
sesh
and the previoust-smart-tmux-session-manager
!I'm trying to migrate from
t
tosesh
but facing the following problem.Description
I'm using tmuxp to
fzf
find and loadtmux
sessions:The following is extracted from my modified
t
:I'm hoping
sesh
would have the following:sesh list ~/.config/tmuxp
tmuxp load -d
Such that I can use the following:
I understand that this may be out of project scope. I hacked on the original
t
because it's a bash script, but I'm not sure about golang.Thank you again!