mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-09-22 07:56:53 +00:00
Fix tailssh pixels
This commit is contained in:
@@ -582,11 +582,13 @@ func (s *Server) handleSession(session gliderssh.Session) {
|
||||
session.DisablePTYEmulation()
|
||||
command := session.RawCommand()
|
||||
var term string
|
||||
var rows, cols uint16
|
||||
var rows, cols, widthPixels, heightPixels uint16
|
||||
if isPty {
|
||||
term = ptyReq.Term
|
||||
rows = clampWindowDimension(ptyReq.Window.Height)
|
||||
cols = clampWindowDimension(ptyReq.Window.Width)
|
||||
widthPixels = clampWindowDimension(ptyReq.Window.WidthPixels)
|
||||
heightPixels = clampWindowDimension(ptyReq.Window.HeightPixels)
|
||||
}
|
||||
var rec *recording
|
||||
recorderList, onFailure := recorders(connInfo)
|
||||
@@ -611,12 +613,14 @@ func (s *Server) handleSession(session gliderssh.Session) {
|
||||
}
|
||||
}
|
||||
shellSession, err := s.backend.OpenSession(shellRequest{
|
||||
User: localUser,
|
||||
Command: command,
|
||||
Env: env,
|
||||
Term: term,
|
||||
Rows: rows,
|
||||
Cols: cols,
|
||||
User: localUser,
|
||||
Command: command,
|
||||
Env: env,
|
||||
Term: term,
|
||||
Rows: rows,
|
||||
Cols: cols,
|
||||
WidthPixels: widthPixels,
|
||||
HeightPixels: heightPixels,
|
||||
})
|
||||
if err != nil {
|
||||
s.logger.Error("failed to open shell session: ", err)
|
||||
@@ -661,7 +665,12 @@ func (s *Server) handleSession(session gliderssh.Session) {
|
||||
for win := range winCh {
|
||||
shellAccess.Lock()
|
||||
if shellAlive {
|
||||
shellSession.Resize(clampWindowDimension(win.Height), clampWindowDimension(win.Width))
|
||||
shellSession.Resize(
|
||||
clampWindowDimension(win.Height),
|
||||
clampWindowDimension(win.Width),
|
||||
clampWindowDimension(win.WidthPixels),
|
||||
clampWindowDimension(win.HeightPixels),
|
||||
)
|
||||
}
|
||||
shellAccess.Unlock()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user