From 21c087afd701dbab8976b46672a46d4967743e5d Mon Sep 17 00:00:00 2001 From: Amir Mullagaliev Date: Fri, 31 Mar 2023 10:55:12 +0500 Subject: [PATCH] Open VSCode in a new window --- main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 01963f5..c243035 100644 --- a/main.go +++ b/main.go @@ -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) {