From 39ee41921f364d05da333621ed1b2ebdcb7ac2f9 Mon Sep 17 00:00:00 2001 From: Sylvie Crowe <107814465+oneirocosm@users.noreply.github.com> Date: Thu, 18 Apr 2024 14:51:11 -0700 Subject: [PATCH] fix: add a new line when writing to knownhosts (#582) This fixes issue #476 by ensuring that when waveterm writes to a knownhosts file, a newline character is appended at the end. --- wavesrv/pkg/remote/sshclient.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wavesrv/pkg/remote/sshclient.go b/wavesrv/pkg/remote/sshclient.go index ee56aba16..f235accde 100644 --- a/wavesrv/pkg/remote/sshclient.go +++ b/wavesrv/pkg/remote/sshclient.go @@ -292,7 +292,7 @@ func writeToKnownHosts(knownHostsFile string, newLine string, getUserVerificatio return UserInputCancelError{Err: fmt.Errorf("canceled by the user")} } - _, err = f.WriteString(newLine) + _, err = f.WriteString(newLine + "\n") if err != nil { f.Close() return err