@@ -80,9 +80,9 @@ func sshCode(host, dir string, o options) error {
8080 dlScript := downloadScript (codeServerPath )
8181
8282 // Downloads the latest code-server and allows it to be executed.
83- sshCmdStr := fmt .Sprintf ("ssh %v %v '/usr/bin/env bash'" , o .sshFlags , host )
83+ sshCmdStr := fmt .Sprintf ("ssh %v %v '/usr/bin/env bash -l '" , o .sshFlags , host )
8484
85- sshCmd := exec .Command ("sh" , "-c" , sshCmdStr )
85+ sshCmd := exec .Command ("sh" , "-l" , "- c" , sshCmdStr )
8686 sshCmd .Stdout = os .Stdout
8787 sshCmd .Stderr = os .Stderr
8888 sshCmd .Stdin = strings .NewReader (dlScript )
@@ -123,7 +123,7 @@ func sshCode(host, dir string, o options) error {
123123 )
124124
125125 // Starts code-server and forwards the remote port.
126- sshCmd = exec .Command ("sh" , "-c" , sshCmdStr )
126+ sshCmd = exec .Command ("sh" , "-l" , "- c" , sshCmdStr )
127127 sshCmd .Stdin = os .Stdin
128128 sshCmd .Stdout = os .Stdout
129129 sshCmd .Stderr = os .Stderr
@@ -533,7 +533,7 @@ func parseHost(host string) (parsedHost string, additionalFlags string, err erro
533533func parseGCPSSHCmd (instance string ) (ip , sshFlags string , err error ) {
534534 dryRunCmd := fmt .Sprintf ("gcloud compute ssh --dry-run %v" , instance )
535535
536- out , err := exec .Command ("sh" , "-c" , dryRunCmd ).CombinedOutput ()
536+ out , err := exec .Command ("sh" , "-l" , "- c" , dryRunCmd ).CombinedOutput ()
537537 if err != nil {
538538 return "" , "" , xerrors .Errorf ("%s: %w" , out , err )
539539 }
0 commit comments