Skip to content

Commit 555884f

Browse files
authored
fix: tmuxinator (#172)
- Add "dir" strategy - Improve "new" logic (it was swapped incorrectly)
1 parent 7c05d27 commit 555884f

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

connector/connect.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ func (c *RealConnector) Connect(name string, opts model.ConnectOpts) (string, er
2424
"tmux": connectToTmux,
2525
"tmuxinator": connectToTmuxinator,
2626
"config": connectToTmux,
27+
"dir": connectToTmux,
2728
"zoxide": connectToTmux,
2829
}
2930

connector/tmux.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,13 @@ func tmuxStrategy(c *RealConnector, name string) (model.Connection, error) {
1212
Session: session,
1313
New: false,
1414
AddToZoxide: true,
15-
// Switch: true
1615
}, nil
1716
}
1817

1918
func connectToTmux(c *RealConnector, connection model.Connection, opts model.ConnectOpts) (string, error) {
2019
if connection.New {
21-
return c.tmux.SwitchOrAttach(connection.Session.Name, opts)
20+
c.tmux.NewSession(connection.Session.Name, connection.Session.Path)
21+
c.startup.Exec(connection.Session)
2222
}
23-
c.tmux.NewSession(connection.Session.Name, connection.Session.Path)
24-
c.startup.Exec(connection.Session)
2523
return c.tmux.SwitchOrAttach(connection.Session.Name, opts)
2624
}

0 commit comments

Comments
 (0)