fix: Terminal emulation used by SSH sessions (#3473)

Fixes #3371
This commit is contained in:
Mathias Fredriksson
2022-09-12 19:27:51 +03:00
committed by GitHub
parent b4c29f34c3
commit 09da3858ce
15 changed files with 388 additions and 83 deletions

View File

@ -195,6 +195,13 @@ func ssh() *cobra.Command {
// shutdown of services.
defer cancel()
if validOut {
// Set initial window size.
width, height, err := term.GetSize(int(stdoutFile.Fd()))
if err == nil {
_ = sshSession.WindowChange(height, width)
}
}
err = sshSession.Wait()
if err != nil {
// If the connection drops unexpectedly, we get an ExitMissingError but no other