Skip to content

Commit

Permalink
Initialize terminal pty with initial size set (#277)
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 <amisevsk@redhat.com>
  • Loading branch information
amisevsk authored Jan 30, 2024
1 parent b590a6f commit 5593cec
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 5593cec

Please sign in to comment.