fix: Update initial window size on SSH TTY (#1174)

It required a window resize before to trigger
a size update. This fixes it!
This commit is contained in:
Kyle Carberry
2022-04-25 18:02:54 -05:00
committed by GitHub
parent 947e8f9d2e
commit 29d55887f9

View File

@ -331,6 +331,10 @@ func (a *agent) handleSSHSession(session ssh.Session) error {
if err != nil { if err != nil {
return xerrors.Errorf("start command: %w", err) return xerrors.Errorf("start command: %w", err)
} }
err = ptty.Resize(uint16(sshPty.Window.Height), uint16(sshPty.Window.Width))
if err != nil {
return xerrors.Errorf("resize ptty: %w", err)
}
go func() { go func() {
for win := range windowSize { for win := range windowSize {
err = ptty.Resize(uint16(win.Height), uint16(win.Width)) err = ptty.Resize(uint16(win.Height), uint16(win.Width))