Skip to content

Commit

Permalink
pass flexrows through to packet.TermOpts so it gets back to the FE co…
Browse files Browse the repository at this point in the history
…rrectly. this fixes wterm overrides and github issue #116 (#134)
  • Loading branch information
sawka authored Dec 12, 2023
1 parent e79dcaf commit 4adcf6d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions waveshell/pkg/packet/packet.go
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,7 @@ type TermOpts struct {
Cols int `json:"cols"`
Term string `json:"term"`
MaxPtySize int64 `json:"maxptysize,omitempty"`
FlexRows bool `json:"flexrows,omitempty"`
}

type RemoteFd struct {
Expand Down
3 changes: 2 additions & 1 deletion wavesrv/pkg/cmdrunner/termopts.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,15 @@ func GetUITermOpts(winSize *packet.WinSize, ptermStr string) (*packet.TermOpts,
termOpts.MaxPtySize = base.BoundInt64(termOpts.MaxPtySize, shexec.MinMaxPtySize, shexec.MaxMaxPtySize)
termOpts.Cols = base.BoundInt(termOpts.Cols, shexec.MinTermCols, shexec.MaxTermCols)
termOpts.Rows = base.BoundInt(termOpts.Rows, shexec.MinTermRows, shexec.MaxTermRows)
termOpts.FlexRows = opts.RowsFlex
return termOpts, nil
}

func convertTermOpts(pkto *packet.TermOpts) *sstore.TermOpts {
return &sstore.TermOpts{
Rows: int64(pkto.Rows),
Cols: int64(pkto.Cols),
FlexRows: true,
FlexRows: pkto.FlexRows,
MaxPtySize: pkto.MaxPtySize,
}
}
2 changes: 1 addition & 1 deletion wavesrv/pkg/remote/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -1414,7 +1414,7 @@ func (msh *MShellProc) SendFileData(dataPk *packet.FileDataPacketType) error {
}

func makeTermOpts(runPk *packet.RunPacketType) sstore.TermOpts {
return sstore.TermOpts{Rows: int64(runPk.TermOpts.Rows), Cols: int64(runPk.TermOpts.Cols), FlexRows: true, MaxPtySize: DefaultMaxPtySize}
return sstore.TermOpts{Rows: int64(runPk.TermOpts.Rows), Cols: int64(runPk.TermOpts.Cols), FlexRows: runPk.TermOpts.FlexRows, MaxPtySize: DefaultMaxPtySize}
}

// returns (ok, currentPSC)
Expand Down

0 comments on commit 4adcf6d

Please sign in to comment.