Swap width and height when allocating a pty

RequestPty from crypto/ssh looks like this:

func (s *Session) RequestPty(term string, h, w int, termmodes TerminalModes) error

So arguments 2 and 3 are height and width, respectively. I'm not sure if
the original was just a typo, or if there's an actual reason we want a
40 column terminal. Either way, having a terminal this narrow led me to
a really "fun" bug[0], where `wget` in my shell provisioner scripts
would segfault when trying to display the progress bar.

[0] http://lists.gnu.org/archive/html/bug-wget/2016-02/msg00041.html
This commit is contained in:
Alex Brown 2016-04-06 15:40:19 -04:00
parent 4f0f05fb8e
commit 0cea0e5c24
1 changed files with 1 additions and 1 deletions

View File

@ -94,7 +94,7 @@ func (c *comm) Start(cmd *packer.RemoteCmd) (err error) {
ssh.TTY_OP_OSPEED: 14400, // output speed = 14.4kbaud ssh.TTY_OP_OSPEED: 14400, // output speed = 14.4kbaud
} }
if err = session.RequestPty("xterm", 80, 40, termModes); err != nil { if err = session.RequestPty("xterm", 40, 80, termModes); err != nil {
return return
} }
} }