Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Fish custom key binding with y function doesn't update fish prompt directory #1963

Closed
3 tasks done
jcelaya775 opened this issue Nov 28, 2024 · 0 comments
Closed
3 tasks done

Comments

@jcelaya775
Copy link

jcelaya775 commented Nov 28, 2024

What system are you running Yazi on?

macOS

What terminal are you running Yazi in?

kitty 0.34.1

yazi --debug output

Yazi
    Version: 0.3.3 (Homebrew 2024-09-04)
    Debug  : false
    OS     : macos-aarch64 (unix)

Ya
    Version: 0.3.3 (Homebrew 2024-09-04)

Emulator
    Emulator.via_env: ("tmux-256color", "tmux")
    Emulator.via_csi: Ok(Kitty)
    Emulator.detect : Kitty

Adapter
    Adapter.matches: Kitty

Desktop
    XDG_SESSION_TYPE           : None
    WAYLAND_DISPLAY            : None
    DISPLAY                    : None
    SWAYSOCK                   : None
    HYPRLAND_INSTANCE_SIGNATURE: None
    WAYFIRE_SOCKET             : None

SSH
    shared.in_ssh_connection: false

WSL
    WSL: false

Variables
    SHELL              : Some("/opt/homebrew/bin/fish")
    EDITOR             : Some("nvim")
    VISUAL             : None
    YAZI_FILE_ONE      : None
    YAZI_CONFIG_HOME   : Some("/Users/jorge/.config/yazi/")

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 })

Multiplexers
    TMUX               : true
    tmux version       : tmux 3.5a
    ZELLIJ_SESSION_NAME: None
    Zellij version     : No such file or directory (os error 2)

Dependencies
    file             : 5.41
    ueberzugpp       : No such file or directory (os error 2)
    ffmpegthumbnailer: 2.2.3
    magick           : 7.1.1-41
    fzf              : 0.56.3
    fd               : 10.2.0
    rg               : 14.1.1
    chafa            : No such file or directory (os error 2)
    zoxide           : 0.9.6
    7z               : No such file or directory (os error 2)
    7zz              : 24.08
    jq               : 1.7.1


--------------------------------------------------
When reporting a bug, please also upload the `yazi.log` log file - only upload the most recent content by time.
You can find it in the "/Users/jorge/.local/state/yazi" directory.

Describe the bug

In fish shell, I configured a custom key binding (ctrl+y) to run the shell wrapper function, but when I press ctrl+y in fish and then switch directories inside yazi and then press q, the fish prompt is still showing the original directory unless I enter another command, and only then does it show the correct directory that yazi cd'd into. The is probably a fish prompt issue, but figured I would bring this up since someone else might be trying the same thing.

Minimal reproducer

Paste the following into ~/.config/fish/config.fish:

function y
      set tmp (mktemp -t "yazi-cwd.XXXXXX")
      yazi $argv --cwd-file="$tmp"
      if set cwd (command cat -- "$tmp"); and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ]
        builtin cd -- "$cwd"
      end
      rm -f -- "$tmp"
end

bind -M insert \cy 'y'

Follow these steps using fish shell:

  1. pwd (original directory, before pressing ctrl+y):
    image

  2. Press ctrl+y:
    image

  3. Move into another directory:
    image

  4. Press q (the correct directory is not being displayed in the fish prompt):
    image

  5. pwd again (the fish prompt only shows the correct directory after entering another command):
    image

Anything else?

This behavior doesn't occur when I run y in fish (without the custom key binding), and it works as expected.

Validations

  • I tried the latest nightly build, and the issue is still reproducible
  • I updated the debug information (yazi --debug) input box to the nightly that I tried
  • I can reproduce it after disabling all custom configs/plugins (mv ~/.config/yazi ~/.config/yazi-backup)
@jcelaya775 jcelaya775 added the bug Something isn't working label Nov 28, 2024
@jcelaya775 jcelaya775 changed the title Using fish custom key binding with y function Fish custom key binding with y function doesn't update fish prompt Nov 28, 2024
@jcelaya775 jcelaya775 changed the title Fish custom key binding with y function doesn't update fish prompt Fish custom key binding with y function doesn't update fish prompt directory Nov 28, 2024
@sxyazi sxyazi removed the bug Something isn't working label Nov 28, 2024
Repository owner locked and limited conversation to collaborators Nov 28, 2024
@sxyazi sxyazi converted this issue into discussion #1964 Nov 28, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants