From 5d3c4e433ee65508b0fd42bd6bd3ee8a900820b5 Mon Sep 17 00:00:00 2001 From: Chenyang Liu Date: Mon, 9 Nov 2015 16:14:24 -0500 Subject: [PATCH] use exec to prevent spawn unneeded subprocess --- unix.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unix.go b/unix.go index afdf11c..62bce71 100644 --- a/unix.go +++ b/unix.go @@ -16,7 +16,7 @@ func ShellInvocationCommand(interactive bool, root, command string) []string { shellArgument = "-ic" } profile := filepath.Join(root, ".profile") - shellCommand := fmt.Sprintf("source \"%s\" 2>/dev/null; %s", profile, command) + shellCommand := fmt.Sprintf("source \"%s\" 2>/dev/null; exec %s", profile, command) return []string{"bash", shellArgument, shellCommand} }