kovidgoyal/kitty · error

No key specified after

Error message

No key specified after %s %s

What it means

In the space-separated --flag value form, ParseMap cuts the value off at the next space; if no more text follows, there is no key spec remaining and it errors with both the flag and the consumed value.

Solutions

  1. Add the key spec and action after the value
  2. Trim spaces inside the comma list: use shifted,ascii without spaces, or prefer the = form

Example fix

# before
map --allow-fallback none
# after
map --allow-fallback none ctrl+a 1
Defensive patterns

Strategy: validation

Validate before calling

_, after, ok := strings.Cut(rest, " ")
if !ok { return fmt.Errorf("no key spec after --allow-fallback value") }

Prevention

When it happens

Trigger: `map --allow-fallback none` where nothing follows the value — the value consumed the rest of the line leaving no key/action.

Common situations: Forgetting the key/action after the flag value, or the value itself containing a space (e.g. `--allow-fallback shifted, ascii`) which truncates the line.

Understand the failure class

Background: "missing required config value" errors: why libraries refuse to start when a configuration key is empty, unset, or blank — this error's family across 48 libraries.

Related errors


AI-assisted analysis of kovidgoyal/kitty@6d5d0c4406 (2026-08-27). Data as JSON: /api/errors/fe71b11bf18cddd2. Report an issue: GitHub.

Appendix: source

Thrown at tools/config/utils.go:302

				if err := validateAllowFallback(value); err != nil {
					return nil, err
				}
				if value == "none" {
					allow_fallback = ""
				} else {
					allow_fallback = value
				}
			default:
				return nil, fmt.Errorf("Unknown map option: %s", flag)
			}
		} else {
			// --flag value form (space-separated)
			name := strings.ReplaceAll(flag[2:], "-", "_")
			switch name {
			case "allow_fallback":
				value, after, has_more := strings.Cut(rest, " ")
				if !has_more {
					return nil, fmt.Errorf("No key specified after %s %s", flag, value)
				}
				if err := validateAllowFallback(value); err != nil {
					return nil, err
				}
				if value == "none" {
					allow_fallback = ""
				} else {
					allow_fallback = value
				}
				rest = strings.TrimSpace(after)
			default:
				return nil, fmt.Errorf("Unknown map option: %s", flag)
			}
		}
		val = rest
	}
	spec, action, found := strings.Cut(val, " ")
	if !found {

View on GitHub (pinned to 6d5d0c4406)