Skip to content

Make mouse actions configurable #2790

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
3 tasks done
alonso-herreros opened this issue May 24, 2025 · 1 comment
Open
3 tasks done

Make mouse actions configurable #2790

alonso-herreros opened this issue May 24, 2025 · 1 comment
Labels
feature New feature request

Comments

@alonso-herreros
Copy link

alonso-herreros commented May 24, 2025

yazi --debug output

Yazi
    Version: 25.4.8 (Arch Linux 2025-04-09)
    Debug  : false
    Triple : x86_64-unknown-linux-gnu (linux-x86_64)
    Rustc  : 1.86.0 (05f9846f 2025-03-31)

Ya
    Version: 25.4.8 (Arch Linux 2025-04-09)

Emulator
    TERM                : Some("xterm-kitty")
    TERM_PROGRAM        : None
    TERM_PROGRAM_VERSION: None
    Brand.from_env      : Some(Kitty)
    Emulator.detect     : Emulator { kind: Left(Kitty), light: false, cell_size: Some((9, 19)) }

Adapter
    Adapter.matches    : Kgp
    Dimension.available: WindowSize { rows: 27, columns: 105, width: 945, height: 513 }

Desktop
    XDG_SESSION_TYPE           : Some("wayland")
    WAYLAND_DISPLAY            : Some("wayland-1")
    DISPLAY                    : Some(":0")
    SWAYSOCK                   : None
    HYPRLAND_INSTANCE_SIGNATURE: Some("9958d297641b5c84dcff93f9039d80a5ad37ab00_1748101111_476184418")
    WAYFIRE_SOCKET             : None

SSH
    shared.in_ssh_connection: false

WSL
    WSL: false

Variables
    SHELL           : Some("/usr/bin/zsh")
    EDITOR          : Some("vim")
    VISUAL          : None
    YAZI_FILE_ONE   : None
    YAZI_CONFIG_HOME: None
    YAZI_ZOXIDE_OPTS: None
    FZF_DEFAULT_OPTS: None

Text Opener
    default     : Some(OpenerRule { run: "${EDITOR:-vi} \"$@\"", block: true, orphan: false, desc: "Use $EDITOR", for_: None, spread: true })
    block-create: Some(OpenerRule { run: "${EDITOR:-vi} \"$@\"", block: true, orphan: false, desc: "Use $EDITOR", for_: None, spread: true })
    block-rename: Some(OpenerRule { run: "${EDITOR:-vi} \"$@\"", block: true, orphan: false, desc: "Use $EDITOR", for_: None, spread: true })

Multiplexers
    TMUX               : false
    tmux version       : tmux 3.5a
    tmux build flags   : enable-sixel=Unknown
    ZELLIJ_SESSION_NAME: None
    Zellij version     : No such file or directory (os error 2)

Dependencies
    file          : 5.46
    ueberzugpp    : No such file or directory (os error 2)
    ffmpeg/ffprobe: 7.1.1 / 7.1.1
    pdftoppm      : 25.05.0
    magick        : 7.1.1-47
    fzf           : 0.62.0
    fd/fdfind     : 10.2.0 / No such file or directory (os error 2)
    rg            : 14.1.1
    chafa         : 1.14.5
    zoxide        : 0.9.7
    7zz/7z        : No such file or directory (os error 2) / 24.09
    jq            : 1.7.1

Clipboard
    wl-copy/paste: 2.2.1 / 2.2.1
    xclip        : No such file or directory (os error 2)
    xsel         : No such file or directory (os error 2)

Routine
    `file -bL --mime-type`: text/plain


See https://yazi-rs.github.io/docs/plugins/overview#debugging on how to enable logging or debug runtime errors.

Please describe the problem you're trying to solve

First, thanks for this amazing file manager.

Mouse support was added last year, and the issues/comments mentioned configuring keymap.toml, but the current implementation doesn't seem to provide any way to customize mouse actions (or at least, I couldn't find it). In my case, I'd like to re-map the right click to a plugin action (smart-enter) or a different action (like open --interactive) instead of open, or map the middle click to something else entirely. Also, it might be cool to support double clicks, but maybe that's too hard.

Would you be willing to contribute this feature?

  • Yes, I'll give it a shot

Describe the solution you'd like

I'd like to be able to configure what the left and middle clicks do, by using some mapping in keymap.toml. It should probably select the item under the cursor before running the action, act on the current selection if there is one, or on the currently hovered item if there's nothing under the cursor.

About hovering on a preview, maybe that could have its own mapping, act on the file at the preview, or maybe have it do nothing.

Additional context

No response

Checklist

  • I have searched the existing issues/discussions
  • The latest nightly build doesn't already have this feature
@alonso-herreros alonso-herreros added the feature New feature request label May 24, 2025
@br4qua
Copy link

br4qua commented Jun 3, 2025

This would be a great feature to have!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature request
Projects
None yet
Development

No branches or pull requests

2 participants