Skip to content

bug: Git Bash (MinTTY) on Windows reports non-TTY — first-run wizard never launches #154

@greynewell

Description

@greynewell

Problem

On Windows, many developers use Git Bash (which uses MinTTY for its terminal emulation). MinTTY creates a pseudo-TTY that golang.org/x/term's term.IsTerminal(syscall.Stdin) does not recognise as a TTY, because MinTTY doesn't use the Windows Console API.

Result: a user on Git Bash with no API key runs bare supermodel and gets:

Error: not authenticated — run `supermodel setup` or set SUPERMODEL_API_KEY

instead of the setup wizard — despite being at an interactive terminal.

Affected environments

  • Git Bash (MSYS2/MinGW)
  • Cygwin terminals
  • Any Windows terminal not using the Windows Console API

Windows Terminal and PowerShell are unaffected (they use the Console API and register correctly).

Reproduction

  1. Install supermodel on Windows
  2. Open Git Bash with no config
  3. Run supermodel
  4. Expected: setup wizard launches
  5. Actual: auth error

Possible fix

Check TERM, TERM_PROGRAM, or MSYSTEM env vars as a fallback when term.IsTerminal returns false. Alternatively, check if /dev/tty is openable (POSIX fallback that MinTTY supports):

var stdinIsTerminal = func() bool {
    if term.IsTerminal(int(syscall.Stdin)) {
        return true
    }
    // Fallback for MinTTY / Cygwin on Windows
    if f, err := os.Open("/dev/tty"); err == nil {
        f.Close()
        return true
    }
    return false
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions