@@ -56,9 +56,9 @@ func sshCode(host, dir string, o options) error {
56
56
dlScript := downloadScript (codeServerPath )
57
57
58
58
// Downloads the latest code-server and allows it to be executed.
59
- sshCmdStr := fmt .Sprintf ("ssh %v %v '/usr/bin/env bash'" , o .sshFlags , host )
59
+ sshCmdStr := fmt .Sprintf ("ssh %v %v '/usr/bin/env bash -l '" , o .sshFlags , host )
60
60
61
- sshCmd := exec .Command ("sh" , "-c" , sshCmdStr )
61
+ sshCmd := exec .Command ("sh" , "-l" , "- c" , sshCmdStr )
62
62
sshCmd .Stdout = os .Stdout
63
63
sshCmd .Stderr = os .Stderr
64
64
sshCmd .Stdin = strings .NewReader (dlScript )
@@ -99,7 +99,7 @@ func sshCode(host, dir string, o options) error {
99
99
)
100
100
101
101
// Starts code-server and forwards the remote port.
102
- sshCmd = exec .Command ("sh" , "-c" , sshCmdStr )
102
+ sshCmd = exec .Command ("sh" , "-l" , "- c" , sshCmdStr )
103
103
sshCmd .Stdin = os .Stdin
104
104
sshCmd .Stdout = os .Stdout
105
105
sshCmd .Stderr = os .Stderr
@@ -396,7 +396,7 @@ func parseHost(host string) (parsedHost string, additionalFlags string, err erro
396
396
func parseGCPSSHCmd (instance string ) (ip , sshFlags string , err error ) {
397
397
dryRunCmd := fmt .Sprintf ("gcloud compute ssh --dry-run %v" , instance )
398
398
399
- out , err := exec .Command ("sh" , "-c" , dryRunCmd ).CombinedOutput ()
399
+ out , err := exec .Command ("sh" , "-l" , "- c" , dryRunCmd ).CombinedOutput ()
400
400
if err != nil {
401
401
return "" , "" , xerrors .Errorf ("%s: %w" , out , err )
402
402
}
0 commit comments