@@ -80,9 +80,9 @@ func sshCode(host, dir string, o options) error {
80
80
dlScript := downloadScript (codeServerPath )
81
81
82
82
// 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 )
84
84
85
- sshCmd := exec .Command ("sh" , "-c" , sshCmdStr )
85
+ sshCmd := exec .Command ("sh" , "-l" , "- c" , sshCmdStr )
86
86
sshCmd .Stdout = os .Stdout
87
87
sshCmd .Stderr = os .Stderr
88
88
sshCmd .Stdin = strings .NewReader (dlScript )
@@ -123,7 +123,7 @@ func sshCode(host, dir string, o options) error {
123
123
)
124
124
125
125
// Starts code-server and forwards the remote port.
126
- sshCmd = exec .Command ("sh" , "-c" , sshCmdStr )
126
+ sshCmd = exec .Command ("sh" , "-l" , "- c" , sshCmdStr )
127
127
sshCmd .Stdin = os .Stdin
128
128
sshCmd .Stdout = os .Stdout
129
129
sshCmd .Stderr = os .Stderr
@@ -533,7 +533,7 @@ func parseHost(host string) (parsedHost string, additionalFlags string, err erro
533
533
func parseGCPSSHCmd (instance string ) (ip , sshFlags string , err error ) {
534
534
dryRunCmd := fmt .Sprintf ("gcloud compute ssh --dry-run %v" , instance )
535
535
536
- out , err := exec .Command ("sh" , "-c" , dryRunCmd ).CombinedOutput ()
536
+ out , err := exec .Command ("sh" , "-l" , "- c" , dryRunCmd ).CombinedOutput ()
537
537
if err != nil {
538
538
return "" , "" , xerrors .Errorf ("%s: %w" , out , err )
539
539
}
0 commit comments