File tree 1 file changed +9
-1
lines changed
1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 9
9
"strings"
10
10
11
11
"al.essio.dev/pkg/shellescape"
12
+ "github.com/coreos/go-semver/semver"
12
13
"github.com/lima-vm/lima/pkg/sshutil"
13
14
"github.com/lima-vm/lima/pkg/store"
14
15
"github.com/mattn/go-isatty"
@@ -184,8 +185,15 @@ func shellAction(cmd *cobra.Command, args []string) error {
184
185
// SendEnv config is cumulative, with already existing options in ssh_config
185
186
sshArgs = append (sshArgs , "-o" , "SendEnv=COLORTERM" )
186
187
}
188
+ logLevel := "ERROR"
189
+ // For versions older than OpenSSH 8.9p, LogLevel=QUIET was needed to
190
+ // avoid the "Shared connection to 127.0.0.1 closed." message with -t.
191
+ olderSSH := sshutil .DetectOpenSSHVersion ().LessThan (* semver .New ("8.9.0" ))
192
+ if olderSSH {
193
+ logLevel = "QUIET"
194
+ }
187
195
sshArgs = append (sshArgs , []string {
188
- "-o" , "LogLevel=ERROR" ,
196
+ "-o" , fmt . Sprintf ( "LogLevel=%s" , logLevel ) ,
189
197
"-p" , strconv .Itoa (inst .SSHLocalPort ),
190
198
inst .SSHAddress ,
191
199
"--" ,
You can’t perform that action at this time.
0 commit comments