@@ -56,9 +56,9 @@ func sshCode(host, dir string, o options) error {
5656 dlScript := downloadScript (codeServerPath )
5757
5858 // 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 )
6060
61- sshCmd := exec .Command ("sh" , "-c" , sshCmdStr )
61+ sshCmd := exec .Command ("sh" , "-l" , "- c" , sshCmdStr )
6262 sshCmd .Stdout = os .Stdout
6363 sshCmd .Stderr = os .Stderr
6464 sshCmd .Stdin = strings .NewReader (dlScript )
@@ -99,7 +99,7 @@ func sshCode(host, dir string, o options) error {
9999 )
100100
101101 // Starts code-server and forwards the remote port.
102- sshCmd = exec .Command ("sh" , "-c" , sshCmdStr )
102+ sshCmd = exec .Command ("sh" , "-l" , "- c" , sshCmdStr )
103103 sshCmd .Stdin = os .Stdin
104104 sshCmd .Stdout = os .Stdout
105105 sshCmd .Stderr = os .Stderr
@@ -396,7 +396,7 @@ func parseHost(host string) (parsedHost string, additionalFlags string, err erro
396396func parseGCPSSHCmd (instance string ) (ip , sshFlags string , err error ) {
397397 dryRunCmd := fmt .Sprintf ("gcloud compute ssh --dry-run %v" , instance )
398398
399- out , err := exec .Command ("sh" , "-c" , dryRunCmd ).CombinedOutput ()
399+ out , err := exec .Command ("sh" , "-l" , "- c" , dryRunCmd ).CombinedOutput ()
400400 if err != nil {
401401 return "" , "" , xerrors .Errorf ("%s: %w" , out , err )
402402 }
0 commit comments