8000 Plugin Support · Issue #146 · amirlehmam/wmux · GitHub
[go: up one dir, main page]

Skip to content

Plugin Support #146

Closed
Closed

Description

@arnonuem

Unfortuantely we closed this issue #112

Is it possible that plugins can be written for wmux?
I would love to write a plugin for myself to add the following behaviour to wmux:

  • when ever CTRL+K is pressed, let it follow with the DEL key once.

Activity

  1. amirlehmam commented on Aug 5, 2026

    @amirlehmam
    Owner

    Straight answer: I'm not building a plugin runtime, but your use case is shipped as a first-class feature in 0.44.0.

    The reasoning on plugins: the thing you'd want a plugin for sits directly in the terminal input path. Third-party code there means an API I have to keep stable across releases, a sandbox story, and a new way for a bad plugin to eat your keystrokes or your PTY. That's a large permanent surface for what is, in your case, a one-line preference. So instead of a plugin API, wmux now lets you change what a key sends.

    What you asked for:

    # ~/.wmux/config.toml
    [keys]
    "ctrl+k" = "<C-k><Delete>"

    Ctrl+K now transmits 0x0B followed by the Delete sequence (ESC [ 3 ~), in that order, on every press — literally "Ctrl+K, then DEL once". Run wmux reload-config and it's live; no restart.

    The general form is "chord" = "sequence":

    [keys]
    "ctrl+alt+r"   = "clear<CR>"       # text outside <> is typed literally
    "alt+left"     = "<Home>"
    "ctrl+shift+q" = ""                # empty value swallows the key

    Chords accept either ctrl+shift+k or the vim spelling <C-S-k>. Sequence tokens cover <CR> <Esc> <Tab> <S-Tab> <BS> <Delete> <Ins> <Home> <End> <PgUp> <PgDn>, arrows, <F1>–<F12>, <C-x>, <A-x>, <Space>, and <lt> for a literal <. Full table: docs/config.md.

    Worth knowing:

    • Remaps apply inside terminal panes and take priority over wmux's own shortcuts there — remap ctrl+t and Ctrl+T stops opening a tab while a terminal has focus. That's deliberate; it's the point of remapping.
    • Modifiers match exactly, so a ctrl+k remap won't fire on Ctrl+Shift+K.
    • A binding that doesn't parse is reported by wmux config show and skipped — one typo doesn't cost you the rest of your bindings.
    • Deleting the entry and running reload-config unbinds it; the file is the whole state.

    Carrying over the conclusion from #112: wmux transmits the bytes, the program decides what they mean. <C-k><Delete> makes wmux send both keys — whether your shell or coding tool then joins the lines is still that program's line editor. In an editor that forward-deletes across a newline (which is the behaviour you described wanting), that's exactly the pull-up you were after.

    If what you actually want from plugins goes beyond key remaps, open an issue describing the behaviour rather than the mechanism — the same way this one turned out to be a config line rather than a plugin host. Cross-posted on #112 so anyone who lands there finds the config line.

  2. < 9D7B div data-testid="timeline-divider-connector" class="Box_1__gSBsk4">

    arnonuem commented on Aug 5, 2026

    @arnonuem
    Author

    Ok first of all thanks for adding this - much appreciated!
    Second - the funny thing is when i used wave with the same coding tool i got it out of the box (CTRL+k delete entireline and swallow it so i can hammer CTRL+K to delete line by line. So imho its not the coding tool that has to interpret this.

  • arnonuem commented on Aug 5, 2026

    @arnonuem
    Author

    btw CTRL-K is now working how i was used to it and i love it!

  • amirlehmam commented on Aug 6, 2026

    @amirlehmam
    Owner

    btw CTRL-K is now working how i was used to it and i love it!

    Glad it landed. Closing on that.

    On the Wave point — fair criticism, and I won't guess at their internals. What I'll concede is the part that doesn't depend on how they did it: you got the behaviour without configuring anything, and here you had to write a config line for something common enough that a default would have served you better. That's a defaults question, not an architecture one, and it's a reasonable thing to hold against the first cut.

    Leaving the plugin-runtime answer as-is: still not building one. But the pattern this issue established holds — describe the behaviour you want and it may turn out to be a config line rather than a plugin API. Reopen or file fresh if a remap ever swallows a key it shouldn't.

  • Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      No labels
      No labels

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions

        0