sqshq/sampler · error
PTY mode is not supported on Windows
Error message
PTY mode is not supported on Windows
What it means
PtyInteractiveShell.init on Windows is a stub that always returns an error because PTY (pseudo-terminal) sessions are not implemented for the Windows build of this library. Any attempt to set up a PTY interactive shell on Windows fails immediately at initialization time. This is a deliberate platform capability limit, not a user configuration mistake in the shell itself.
Source
Thrown at data/int_pty_windows.go:15
package data
import (
"errors"
"time"
)
type PtyInteractiveShell struct {
item *Item
variables []string
timeout time.Duration
}
func (s *PtyInteractiveShell) init() error {
return errors.New("PTY mode is not supported on Windows")
}
func (s *PtyInteractiveShell) execute() (string, error) {
return "", errors.New("PTY mode is not supported on Windows")
}
View on GitHub (pinned to 9bc7ba732d)
Solutions
- Switch the item's interactive shell type from PTY to 'basic' on Windows
- Guard the PTY setup at startup: on runtime.GOOS == "windows" skip PTY items or fall back to basic shell
- Run the collector on Linux/macOS if PTY interaction is required
- Wrap init() and degrade gracefully: log the error and disable the item instead of failing the whole run
Example fix
// before
shell := item.NewPtyInteractiveShell(item, variables, timeout)
_ = shell.init()
// after
if runtime.GOOS == "windows" {
shell = item.NewBasicInteractiveShell(item, variables, timeout)
} else {
shell = item.NewPtyInteractiveShell(item, variables, timeout)
}
_ = shell.init() Defensive patterns
Strategy: fallback
Validate before calling
if runtime.GOOS == "windows" { useBasicShell = true } Type guard
func ptySupported() bool { return runtime.GOOS != "windows" } Try / catch
if err := shell.init(); err != nil {
log.Printf("PTY unavailable, falling back to basic shell: %v", err)
shell = NewBasicInteractiveShell(item, vars, timeout)
} Prevention
- Gate PTY features on GOOS at startup
- Document Windows limitations for config authors
- Test configs on target OS before deployment
When it happens
Trigger: Configuring an item with interactive PTY shell mode (item.ptyShell = NewPtyInteractiveShell / interactive type 'pty') and calling init() on a Windows build (int_pty_windows.go).
Common situations: Users porting a sampler/config from Linux or macOS to Windows while keeping interactive PTY mode enabled in the YAML.
Understand the failure class
Background: "unsupported platform" / "not supported on this platform" errors: what they mean and how to fix them — this error's family across 47 libraries.
Related errors
- failed to execute command: %s
- errorText.String()
- failed to execute command: %s
- panic(err)
- Failed to load the font:
AI-assisted analysis of sqshq/sampler@9bc7ba732d (2026-09-06).
Data as JSON: /api/errors/f0ba65cd2140b7f1.
Report an issue: GitHub.