Skip to content

talm dashboard / edit under non-tty: panic / hang instead of clean refusal #183

Description

Problem

talm dashboard --nodes $NODE --endpoints $NODE under a non-tty stdin panics in gdamore/tcell rather than failing gracefully with a "needs an interactive terminal" hint.

Reproduction

timeout 3 talm dashboard --nodes $NODE --endpoints $NODE < /dev/null

Output:

panic: close of nil channel

goroutine 150 [running]:
github.com/gdamore/tcell/v2.(*tScreen).finish(...)
        /Users/lex/go/pkg/mod/github.com/gdamore/tcell/v2@v2.13.8/tscreen.go:374
...
exit: 2

The panic comes from tcell's terminal teardown after init refuses to allocate a tty. Upstream issue, but the talm wrapper has the contextual information to refuse earlier with a friendly hint instead.

Expected

pkg/commands/talosctl_wrapper.go (or the dashboard subcommand if it lives in talm) detects non-tty stdin (the same term.IsTerminal(int(os.Stdin.Fd())) check we use for init --update post-#174) and returns:

error: talm dashboard requires an interactive terminal (stdin is not a tty)
hint: run from an attached shell. Scripted use: talm get / talm logs cover most of the dashboard's data.

Cost: a few-line guard. Currently the operator sees a Go stack trace that suggests a bug.

Why this matters

talm dashboard is a popular discovery tool — operators run it locally to inspect a cluster. Some IDE terminals (VS Code's integrated terminal in some configurations, tmux+ssh pipes) present as non-tty under quirky setups. The panic looks like a talm crash, not a misconfiguration.

Same guard would apply to talm edit machineconfig (which currently hangs forever instead of erroring).

Surfaced during the dev17 manual test plan exercise.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/commandsIssues or PRs related to pkg/commands (CLI subcommands, flag parsing, root detection)kind/bugCategorizes issue or PR as related to a bugpriority/important-longtermImportant over the long term, but may not be staffed and/or may need multiple releases to completetriage/acceptedIndicates an issue is ready to be actively worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions