wtfutil/wtf · error

currentCmd execution failed: %w

Error message

currentCmd execution failed: %w

What it means

Raised in the progress widget's Refresh when the configured currentCmd shell command fails (non-zero exit, command not found, or no output) — the widget cannot determine the current value, stores the error, and displays it instead of the progress bar.

Source

Thrown at modules/progress/widget.go:84

			widget.err = fmt.Errorf("minimumCmd execution failed: %w", err)
			widget.display()
			return
		}
	}

	if cmd := widget.settings.maximumCmd; cmd != "" {
		widget.maximum, err = widget.execValueCmd(cmd)
		if err != nil {
			widget.err = fmt.Errorf("maximumCmd execution failed: %w", err)
			widget.display()
			return
		}
	}

	if cmd := widget.settings.currentCmd; cmd != "" {
		widget.current, err = widget.execValueCmd(cmd)
		if err != nil {
			widget.err = fmt.Errorf("currentCmd execution failed: %w", err)
			widget.display()
			return
		}
	}

	widget.calcPercent()

	widget.display()
}

/* -------------------- Unexported Functions -------------------- */

func (widget *Widget) content() string {
	if widget.err != nil {
		return "[red]Error: " + widget.err.Error()
	}

	percent := widget.formatPercent(widget.percent)

View on GitHub (pinned to bb838c1ccb)

Solutions

  1. Run currentCmd manually in the configured shell to reproduce the failure
  2. Check the command exists on PATH or use an absolute path
  3. Ensure the command prints a numeric value to stdout and exits 0
  4. Verify the SHELL environment variable is set
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at modules/progress/widget.go:84 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of wtfutil/wtf@bb838c1ccb (2026-09-03). Data as JSON: /api/errors/c8b5a2dbd65adb54. Report an issue: GitHub.