Skip to content
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

Help is incorrectly rendered when the mapping contains multiline script #1342

Closed
wojciech-kulik opened this issue Jul 24, 2024 · 3 comments · Fixed by #1347
Closed

Help is incorrectly rendered when the mapping contains multiline script #1342

wojciech-kulik opened this issue Jul 24, 2024 · 3 comments · Fixed by #1347
Labels
bug Something isn't working

Comments

@wojciech-kulik
Copy link

What system are you running Yazi on?

macOS

What terminal are you running Yazi in?

kitty 0.35.2

yazi --debug output

##### ↓↓↓ Paste the output here: ↓↓↓ #####
Yazi
    Version: 0.2.5 (Homebrew 2024-07-24)
    Debug  : false
    OS     : macos-aarch64 (unix)

Ya
    Version: 0.2.5

Emulator
    Emulator.via_env: ("xterm-kitty", "")
    Emulator.via_csi: Ok(Kitty)
    Emulator.detect : Kitty

Adapter
    Adapter.matches: Kitty

Desktop
    XDG_SESSION_TYPE: None
    WAYLAND_DISPLAY : None
    DISPLAY         : None

SSH
    shared.in_ssh_connection: false

WSL
    /proc/sys/fs/binfmt_misc/WSLInterop: false

Variables
    SHELL              : Some("/bin/zsh")
    EDITOR             : Some("nvim")
    ZELLIJ_SESSION_NAME: None
    YAZI_FILE_ONE      : None
    YAZI_CONFIG_HOME   : None

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

tmux
    TMUX   : false
    Version: 3.4

Dependencies
    file             : 5.41
    ueberzugpp       : No such file or directory (os error 2)
    ffmpegthumbnailer: 2.2.2
    magick           : 7.1.1-35
    fzf              : 0.54.1
    fd               : 10.1.0
    rg               : 14.1.0
    chafa            : No such file or directory (os error 2)
    zoxide           : 0.9.4
    unar             : 1.10.7
    jq               : 1.7.1

Did you try the latest nightly build to see if the problem got fixed?

Yes, and I updated the debug information above (yazi --debug) to the nightly that I tried

Describe the bug

As you can see, I've got my custom script to zip a file. In the help it overlaps multiple other bindings:

image

Expected Behavior

Only a single line of the script should be presented

To Reproduce

  1. Add a multiline mapping like:
  { on = ["c", "z"], run = ["""
    shell --block --confirm '
      printf "Archive name: "
      read name
      [ -z "$name" ] && exit 0

      mkdir "$name"
      cp "$@" "$name"
      zip -r "$name.zip" "$name"
      rm -rf "$name"
    '
""", "escape --visual --select"], desc = "Archive selected files" },
  1. Check help

Configuration

No response

Anything else?

No response

@wojciech-kulik wojciech-kulik added the bug Something isn't working label Jul 24, 2024
@xfzv
Copy link

xfzv commented Jul 24, 2024

Can confirm on nightly.

Plus, if placed at the very end of the keybindings, the command isn't even displayed on my end:

Untitled

% yazi -V
Yazi 0.2.5 (af0fb59 2024-07-24)

@sxyazi
Copy link
Owner

sxyazi commented Jul 24, 2024

I can reproduce the issue, will create a PR to fix it.

BTW, if you need to compress files, I recommend using the compress.yazi plugin instead of doing it through the shell.

Copy link

I'm going to lock this issue because it has been closed for 30 days. ⏳
This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants