Skip to content

Commit

Permalink
Attach to first window from list-windows. (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamjt authored Dec 22, 2020
1 parent e9ae967 commit 9528b92
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion smug.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ func (smug Smug) Start(config Config, windows []string) error {
return err
}

err = smug.tmux.Attach(ses+"0", os.Stdin, os.Stdout, os.Stderr)
err = smug.tmux.Attach(ses + windows[0], os.Stdin, os.Stdout, os.Stderr)
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions smug_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ var testTable = []struct {
"tmux list-windows -t ses: -F #{window_index}",
"tmux kill-window -t ses:ses:",
"tmux move-window -r",
"tmux attach -t ses:0",
"tmux attach -t ses:ses:",
},
[]string{
"tmux kill-session -t ses",
Expand Down Expand Up @@ -69,7 +69,7 @@ var testTable = []struct {
"tmux list-windows -t ses: -F #{window_index}",
"tmux kill-window -t ses:ses:",
"tmux move-window -r",
"tmux attach -t ses:0",
"tmux attach -t ses:ses:",
},
[]string{
"/bin/sh -c stop1",
Expand Down

0 comments on commit 9528b92

Please sign in to comment.