Skip to content

Commit

Permalink
fix: tmuxinator (#172)
Browse files Browse the repository at this point in the history
- Add "dir" strategy
- Improve "new" logic (it was swapped incorrectly)
  • Loading branch information
joshmedeski committed Sep 20, 2024
1 parent 7c05d27 commit 555884f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 1 addition & 0 deletions connector/connect.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}

Expand Down
6 changes: 2 additions & 4 deletions connector/tmux.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

0 comments on commit 555884f

Please sign in to comment.