add PTY handler

This commit is contained in:
2025-11-06 23:42:56 +01:00
parent 25f29e2dc4
commit 3ec2b90315
2 changed files with 21 additions and 12 deletions

View File

@@ -225,6 +225,15 @@ func main() {
}
func teaHandler(s ssh.Session) (tea.Model, []tea.ProgramOption) {
// Check if PTY is available
ptyReq, _, _ := s.Pty()
if ptyReq.Term == "" {
// No PTY, handle as command execution
s.Write([]byte("This server requires an interactive terminal (PTY).\nPlease connect with: ssh -t user@host\n"))
s.Exit(1)
return nil, nil
}
return model{
showWelcome: true,
focus: 0,