File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 99 "strings"
1010
1111 "al.essio.dev/pkg/shellescape"
12+ "github.com/coreos/go-semver/semver"
1213 "github.com/lima-vm/lima/pkg/sshutil"
1314 "github.com/lima-vm/lima/pkg/store"
1415 "github.com/mattn/go-isatty"
@@ -184,8 +185,15 @@ func shellAction(cmd *cobra.Command, args []string) error {
184185 // SendEnv config is cumulative, with already existing options in ssh_config
185186 sshArgs = append (sshArgs , "-o" , "SendEnv=COLORTERM" )
186187 }
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+ }
187195 sshArgs = append (sshArgs , []string {
188- "-o" , "LogLevel=ERROR" ,
196+ "-o" , fmt . Sprintf ( "LogLevel=%s" , logLevel ) ,
189197 "-p" , strconv .Itoa (inst .SSHLocalPort ),
190198 inst .SSHAddress ,
191199 "--" ,
You can’t perform that action at this time.
0 commit comments