kovidgoyal/kitty · error

No action specified for shortcut %s

Error message

No action specified for shortcut %s

What it means

After consuming any flags, ParseMap splits the remainder into key spec and action at the first space. If there is no space, no action was given and it errors echoing the whole remaining string.

Source

Thrown at tools/config/utils.go:321

				}
				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 {
		return nil, fmt.Errorf("No action specified for shortcut %s", val)
	}
	action = strings.TrimSpace(action)
	action_name, action_args, _ := strings.Cut(action, " ")
	action_args = strings.TrimSpace(action_args)
	return &KeyAction{Name: action_name, Args: action_args, Normalized_keys: NormalizeShortcuts(spec), AllowFallback: allow_fallback}, nil
}

type partialMatch struct {
	action   *KeyAction
	priority int
}

type ShortcutTracker struct {
	partial_matches      []partialMatch
	partial_num_consumed int
}

func (self *ShortcutTracker) Match(ev *loop.KeyEvent, all_actions []*KeyAction) *KeyAction {

View on GitHub (pinned to 6d5d0c4406)

Solutions

  1. Append the action after the key spec
  2. If flags are present, make sure they didn't swallow the action (see errors 625/627)

Example fix

# before
map ctrl+a
# after
map ctrl+a neighboring_window left
Defensive patterns

Strategy: validation

Validate before calling

if !strings.Contains(val, " ") { return fmt.Errorf("map directive missing action: %q", val) }

Prevention

When it happens

Trigger: `map ctrl+a` or `map ctrl+a1` in a config file — a key spec with no action after it.

Common situations: Truncated line during editing, or forgetting that the action is a separate token; also happens when flag parsing consumed the action by mistake.

Related errors


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