AnirudhG07 / custom-shell.yazi

Set your custom-shell as default shell in yazi!
MIT License
9 stars 3 forks source link

zsh: suspended (tty output) #5

Closed uxfion closed 2 months ago

uxfion commented 2 months ago

‌‌‌‌‌The issue of zsh: suspended (tty output) occurs when using the ls commands.

here is some logs FYI:

❯ yazi
free_node           headscale-2024-07-13.tar.gz
headscale           plugins
zsh: suspended (tty output)  

~/Downloads/tmp took 5s 
✦ ❯ fg
[1]  + continued  

Backtrace omitted. Run with RUST_BACKTRACE=1 to display it.
Run with RUST_BACKTRACE=full to include source snippets.

The application panicked (crashed).
  called `Result::unwrap()` on an `Err` value: Interrupted system call (os error 4)
in yazi-fm/src/app/commands/resume.rs, line 8
thread: main

I tested and found that bash does not have this issue.

AnirudhG07 commented 2 months ago

Sorry I am not able to reproduce the issue. Can you share your keymap that you are using and what you entered in the input box. I tried this

[[manager.prepend_keymap]]
on  = [ "'", ";" ]
run = 'plugin custom-shell --args="zsh"'

And input ls, it worked fine. Please share some reproducing steps

uxfion commented 2 months ago

the keymap is as follow:

[[manager.prepend_keymap]]
on  = [ "'" ]
run = "plugin custom-shell --args=zsh"

I found that changing zsh = { shell_val = "zsh", supporter = "-ic" }, to zsh = { shell_val = "zsh", supporter = "-c" }, at https://github.com/AnirudhG07/custom-shell.yazi/blob/main/init.lua#L11 can avoid the issue, perhaps because of the -i argument?

I try to remove -i, it works, but I want to use some alias or env in my ~/.zshrc

reproduce step

docker run -it --rm alpine:latest use alpine for test

/ # cd
~ # mkdir -p ~/.config/yazi ~/.local/bin
~ # wget https://github.com/sxyazi/yazi/releases/download/v0.3.2/yazi-x86_64-unknown-linux-musl.zip
~ # unzip yazi-x86_64-unknown-linux-musl.zip
~ # cp yazi-x86_64-unknown-linux-musl/ya* ~/.local/bin/
~ # export PATH=~/.local/bin:$PATH
~ # apk add zsh git file
~ # zsh
6bcd3dc19dfa# export SHELL=/bin/zsh
6bcd3dc19dfa# ya pack -a AnirudhG07/custom-shell
6bcd3dc19dfa# cat <<EOF > ~/.config/yazi/keymap.toml
[[manager.prepend_keymap]]
on  = [ "'" ]
run = "plugin custom-shell --args=auto"
EOF
6bcd3dc19dfa# yazi

type ' and input ls will reproduce this problem.

AnirudhG07 commented 2 months ago

I hope PR #6 fixes this issue. I am closing it. Feel free to open it for any issues