2026-05-28 18:42:58 +08:00
|
|
|
//go:build with_gvisor
|
|
|
|
|
|
|
|
|
|
package tailssh
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"io"
|
|
|
|
|
|
|
|
|
|
"github.com/sagernet/sing-box/adapter"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type shellBackend interface {
|
|
|
|
|
OpenSession(request shellRequest) (shellSession, error)
|
|
|
|
|
Close() error
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type shellRequest struct {
|
2026-08-19 22:22:17 +08:00
|
|
|
User *adapter.PlatformUser
|
|
|
|
|
Command string
|
|
|
|
|
Env []string
|
|
|
|
|
Term string
|
|
|
|
|
Rows uint16
|
|
|
|
|
Cols uint16
|
|
|
|
|
WidthPixels uint16
|
|
|
|
|
HeightPixels uint16
|
2026-05-28 18:42:58 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type shellSession interface {
|
|
|
|
|
io.ReadWriteCloser
|
|
|
|
|
// CloseWrite signals EOF on the child's stdin without tearing down the
|
|
|
|
|
// session, so programs that read stdin to EOF can finish normally.
|
|
|
|
|
CloseWrite() error
|
2026-08-19 22:22:17 +08:00
|
|
|
Resize(rows, cols, widthPixels, heightPixels uint16) error
|
2026-05-28 18:42:58 +08:00
|
|
|
Signal(sig int) error
|
|
|
|
|
Wait() (exitStatus uint32, err error)
|
|
|
|
|
}
|