Skip to content

Commit

Permalink
Make sure PWD is set on newly created windows
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasefe committed Jul 29, 2016
1 parent 6cb6ffa commit 785ded7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions examples/.ta2
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
uno n
uno v
uno n echo uno
uno v
4 changes: 2 additions & 2 deletions parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func Parse(session string, file *os.File) (cmds []Args) {
line := scanner.Text()
arr := strings.SplitN(line, " ", 3)

if len(arr) != 2 {
if len(arr) < 2 {
continue
}

Expand Down Expand Up @@ -80,7 +80,7 @@ func contains(arr Args, v1 string) bool {
}

func newWindow(session, window string) Args {
return Args{"new-window", "-a", "-t", session, "-n", window, "-c", "$PWD"}
return Args{"new-window", "-a", "-t", session, "-n", window, "-c", os.Getenv("PWD")}
}

func splitWindow(session, window, split, target string) Args {
Expand Down

0 comments on commit 785ded7

Please sign in to comment.