charmbracelet/vhs · error · parser.Error

${windowBar} is not a valid bar style.

Error message

${windowBar} is not a valid bar style.

What it means

Fires in parseSet when the value for the WindowBar setting is not one of the styles accepted by isValidWindowBar. The value is still assigned to cmd.Args; only validity checking fails. This is a guard over the fixed set of bar styles (e.g. '' / dot styles supported by ttyd).

Source

Thrown at parser/parser.go:493

		p.nextToken()
		// Allow TypingSpeed to have bare units (e.g. 10ms)
		// Set TypingSpeed 10ms
		if p.peek.Type == token.MILLISECONDS ||
			p.peek.Type == token.SECONDS {
			cmd.Args += p.peek.Literal
			p.nextToken()
		} else if cmd.Options == "TypingSpeed" {
			cmd.Args += "s"
		}
	case token.WINDOW_BAR:
		cmd.Args = p.peek.Literal
		p.nextToken()

		windowBar := p.cur.Literal
		if !isValidWindowBar(windowBar) {
			p.errors = append(
				p.errors,
				NewError(p.cur, windowBar+" is not a valid bar style."),
			)
		}
	case token.MARGIN_FILL:
		cmd.Args = p.peek.Literal
		p.nextToken()

		marginFill := p.cur.Literal

		// Check if margin color is a valid hex string
		if strings.HasPrefix(marginFill, "#") {
			_, err := strconv.ParseUint(marginFill[1:], 16, 64)

			if err != nil || len(marginFill) != 7 {
				p.errors = append(
					p.errors,
					NewError(
						p.cur,
						"\""+marginFill+"\" is not a valid color.",

View on GitHub (pinned to c073383b5d)

Solutions

  1. Use a valid bar style such as an empty value, or one of the supported names (e.g. ' ' for space style)
  2. Check the valid style list in the codebase (isValidWindowBar) for accepted values
  3. Remove the WindowBar setting to use the default
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at parser/parser.go:493 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of charmbracelet/vhs@c073383b5d (2026-09-02). Data as JSON: /api/errors/2aab0cb9ed9c7e32. Report an issue: GitHub.