Fix tailssh pixels

This commit is contained in:
世界
2026-08-30 17:41:46 +08:00
parent 0a5078a848
commit ec497c7dda
8 changed files with 61 additions and 32 deletions
+17 -8
View File
@@ -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()
}