Skip to content

Commit

Permalink
Use current working directory in case it is not delcared in session
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandrebodin committed Aug 9, 2018
1 parent 4ac5c81 commit 3a8ce1e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions builder/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ func NewSession(sessConfig config.Session, options *tmux.Options) *Session {
TmuxOptions: options,
}

// set dir to current working dir if not defined
if sess.Dir == "" {
dir, err := os.Getwd()
if err == nil {
sess.Dir = dir
}
}

// if no window specified, create a default one
if len(sessConfig.Windows) == 0 {
sess.Windows = []*window{newWindow(sess, config.Window{}, 0)}
Expand Down

0 comments on commit 3a8ce1e

Please sign in to comment.