From 555884f9f4dd2518d53a4e59c0df18ea444a5bfc Mon Sep 17 00:00:00 2001 From: Josh Medeski Date: Thu, 19 Sep 2024 22:06:02 -0400 Subject: [PATCH] fix: tmuxinator (#172) - Add "dir" strategy - Improve "new" logic (it was swapped incorrectly) --- connector/connect.go | 1 + connector/tmux.go | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/connector/connect.go b/connector/connect.go index 5accd21..243732e 100644 --- a/connector/connect.go +++ b/connector/connect.go @@ -24,6 +24,7 @@ func (c *RealConnector) Connect(name string, opts model.ConnectOpts) (string, er "tmux": connectToTmux, "tmuxinator": connectToTmuxinator, "config": connectToTmux, + "dir": connectToTmux, "zoxide": connectToTmux, } diff --git a/connector/tmux.go b/connector/tmux.go index ea619eb..376ff6f 100644 --- a/connector/tmux.go +++ b/connector/tmux.go @@ -12,15 +12,13 @@ func tmuxStrategy(c *RealConnector, name string) (model.Connection, error) { Session: session, New: false, AddToZoxide: true, - // Switch: true }, nil } func connectToTmux(c *RealConnector, connection model.Connection, opts model.ConnectOpts) (string, error) { if connection.New { - return c.tmux.SwitchOrAttach(connection.Session.Name, opts) + c.tmux.NewSession(connection.Session.Name, connection.Session.Path) + c.startup.Exec(connection.Session) } - c.tmux.NewSession(connection.Session.Name, connection.Session.Path) - c.startup.Exec(connection.Session) return c.tmux.SwitchOrAttach(connection.Session.Name, opts) }