kovidgoyal/kitty · error
Invalid allow-fallback value %#v, allowed values: shifted, a
Error message
Invalid allow-fallback value %#v, allowed values: shifted, ascii, none
What it means
The allow-fallback value for a map directive must be one of shifted, ascii, none (or a comma-separated list of shifted/ascii). validateAllowFallback rejects any other token when parsing the map option.
Source
Thrown at tools/config/utils.go:265
type KeyAction struct {
Normalized_keys []string
Name string
Args string
AllowFallback string
}
func (self *KeyAction) String() string {
return fmt.Sprintf("map %#v %#v %#v\n", strings.Join(self.Normalized_keys, ">"), self.Name, self.Args)
}
func validateAllowFallback(value string) error {
if value == "" || value == "none" {
return nil
}
for part := range strings.SplitSeq(value, ",") {
part = strings.TrimSpace(part)
if part != "shifted" && part != "ascii" {
return fmt.Errorf("Invalid allow-fallback value %#v, allowed values: shifted, ascii, none", part)
}
}
return nil
}
func ParseMap(val string) (*KeyAction, error) {
allow_fallback := "shifted"
for strings.HasPrefix(val, "--") {
flag, rest, found := strings.Cut(val, " ")
if !found {
return nil, fmt.Errorf("No key specified after flag %s", flag)
}
rest = strings.TrimSpace(rest)
if name, value, ok := strings.Cut(flag, "="); ok {
// --flag=value form
name = strings.ReplaceAll(name[2:], "-", "_")
switch name {
case "allow_fallback":View on GitHub (pinned to 6d5d0c4406)
Solutions
- Change the value to shifted, ascii, none, or a comma combination like shifted,ascii
- Check spelling and case exactly
- If upgrading, review changelog notes about allow-fallback semantics
Example fix
# before map --allow-fallback=Shifted ctrl+a 1 # after map --allow-fallback=shifted ctrl+a 1
Defensive patterns
Strategy: validation
Validate before calling
valid := map[string]bool{"shifted": true, "ascii": true, "none": true, "": true}
for _, p := range strings.Split(value, ",") {
p = strings.TrimSpace(p)
if !valid[p] { return fmt.Errorf("bad allow-fallback %q", p) }
} Type guard
func isValidAllowFallback(v string) bool {
if v == "" || v == "none" { return true }
for _, p := range strings.Split(v, ",") {
p = strings.TrimSpace(p)
if p != "shifted" && p != "ascii" { return false }
}
return true
} Prevention
- Use exactly shifted, ascii, none in lowercase
- Prefer the comma form without spaces: shifted,ascii
When it happens
Trigger: Passing --allow-fallback=xyz or `--allow-fallback xyz` to a map directive in a config file, where xyz is not shifted, ascii, none, or a comma list of those.
Common situations: Typos like 'shfted' or 'ASCII' (case-sensitive), or assuming legacy values from older kitty versions where this validation did not exist.
Related errors
- No key specified after flag %s
- No key specified after %s %s
- The value {x} is not a known choice
- The value {val} is not a valid choice for progress_bar
- The value {val} is not a valid choice for scrollbar
AI-assisted analysis of kovidgoyal/kitty@6d5d0c4406 (2026-08-27).
Data as JSON: /api/errors/fa2478dd8688f2dd.
Report an issue: GitHub.