//go:build !windows

package api

import (
	"os/exec"

	"github.com/creack/pty/v2"
)

// startTermSession (unix) opens a real PTY via creack/pty. Fatal on error
// — the unix build assumes PTY availability.
func startTermSession(cmd *exec.Cmd) (termSession, error) {
	ptmx, err := pty.Start(cmd)
	if err != nil {
		return nil, err
	}
	return &ptySession{ptmx: ptmx, cmd: cmd}, nil
}
