Skip to content

Commit

Permalink
Open VSCode in a new window
Browse files Browse the repository at this point in the history
  • Loading branch information
electrofocus committed Mar 31, 2023
1 parent 308b698 commit 21c087a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ func main() {
os.Chdir(path)
execCmd("go", "mod", "init", "sandbox")

if editor := os.Getenv("EDITOR"); editor != "" {
if editor := os.Getenv("EDITOR"); editor != "" && editor != "code" {
execCmd(editor, f1.Name())
return
}

execCmd("code", path, "--goto", f1.Name()+":4:2")
execCmd("code", path, "--new-window", "--goto", f1.Name()+":4:2")
}

func execCmd(name string, args ...string) {
Expand Down

0 comments on commit 21c087a

Please sign in to comment.