Skip to content

Commit

Permalink
Initialize terminal pty with initial size set
Browse files Browse the repository at this point in the history
When creating a terminal, queue the initial size of the terminal in the
resize channel to ensure the terminal has correct dimensions upon
opening.

Signed-off-by: Angel Misevski <[email protected]>
  • Loading branch information
amisevsk committed Nov 23, 2023
1 parent 43555a2 commit 04395f9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion exec/kubernetes_exec_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,11 +236,13 @@ func (manager *KubernetesExecManager) doCreate(machineExec *model.MachineExec, c
machineExec.Executor = executor
machineExec.ID = int(atomic.AddUint64(&prevExecID, 1))
machineExec.MsgChan = make(chan []byte)
machineExec.SizeChan = make(chan remotecommand.TerminalSize)
machineExec.SizeChan = make(chan remotecommand.TerminalSize, 1)
machineExec.ExitChan = make(chan bool)
machineExec.ErrorChan = make(chan error)
machineExec.ConnectionHandler = ws.NewConnHandler()

machineExec.SizeChan <- remotecommand.TerminalSize{Width: uint16(machineExec.Cols), Height: uint16(machineExec.Rows)}

execs.execMap[machineExec.ID] = machineExec

return nil
Expand Down

0 comments on commit 04395f9

Please sign in to comment.