Skip to content

Add vim-style :q and :q! command aliases #8071

@moha-abdi

Description

@moha-abdi

Problem

mitmproxy currently has q and Q as direct keybindings:

Key Action
q Exit current view / prompt to quit at top level
Q Exit immediately

This works, but it's inconsistent with the vim pattern that most terminal users expect. In vim, q records macros while :q quits. The command-form (:q) is the deliberate quit action, not a raw keypress.

mitmproxy already has a command system via :, but quitting requires verbose commands like :console.view.pop (quit with confirmation) or :console.exit (quit immediately).

Proposal

Add short aliases to match vim conventions:

Alias Maps to Behavior
:q console.view.pop Pop view / prompt to quit at top level
:q! console.exit Exit immediately without prompt

This preserves the existing q/Q keybindings while adding the familiar command-form for users who prefer explicit commands over direct keypresses.

Implementation

Minimal change, just registering aliases in the command system. Happy to submit a PR if there's interest.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions