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

Exiting yazi leaves some ascii characters in terminal #1026

Closed
dtolnay opened this issue May 11, 2024 · 2 comments · Fixed by #1027
Closed

Exiting yazi leaves some ascii characters in terminal #1026

dtolnay opened this issue May 11, 2024 · 2 comments · Fixed by #1027
Labels
bug Something isn't working

Comments

@dtolnay
Copy link
Contributor

dtolnay commented May 11, 2024

What system are you running Yazi on?

Linux X11

What terminal are you running Yazi in?

rxvt-unicode (urxvt) v9.30

Did you try the latest code to see if this problem got fixed?

Tried, but the problem still

yazi --debug output

Yazi
    Version: 0.2.5 (VERGEN_IDEMPOTENT_OUTPUT 2024-05-11)
    OS: linux-x86_64 (unix)
    Debug: false

Emulator
    Emulator.via_env: ("rxvt-unicode-256color", "")
    Emulator.via_csi: Ok(Unknown([]))
    Emulator.detect: Unknown([])

Adaptor
    Adaptor.matches: X11

Desktop
    XDG_SESSION_TYPE: Some("x11")
    WAYLAND_DISPLAY: None
    DISPLAY: Some(":0")

SSH
    shared.in_ssh_connection: false

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

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

file(1)
    Version: Ok(Output { status: ExitStatus(unix_wait_status(0)), stdout: "file-5.41\nmagic file from /etc/magic:/usr/share/misc/magic\n", stderr: "" })

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

Ueberzug++
    Version: Err(Os { code: 2, kind: NotFound, message: "No such file or directory" })


--------------------------------------------------
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 "/home/david/.local/state/yazi" directory.

yazi.log:

  2024-05-11T20:56:02.500109Z  WARN yazi_adaptor::emulator: [Adaptor] No special environment variables detected
    at /home/david/.cargo/registry/src/index.crates.io-6f17d22bba15001f/yazi-adaptor-0.2.5/src/emulator.rs:66

  2024-05-11T20:56:02.500132Z  WARN yazi_adaptor::emulator: [Adaptor] Unknown TERM_PROGRAM: 
    at /home/david/.cargo/registry/src/index.crates.io-6f17d22bba15001f/yazi-adaptor-0.2.5/src/emulator.rs:80

  2024-05-11T20:56:02.500135Z  WARN yazi_adaptor::emulator: [Adaptor] Unknown TERM: rxvt-unicode-256color
    at /home/david/.cargo/registry/src/index.crates.io-6f17d22bba15001f/yazi-adaptor-0.2.5/src/emulator.rs:87

  2024-05-11T20:56:02.502460Z  WARN yazi_adaptor::ueberzug: ueberzugpp spawning failed: No such file or directory (os error 2)
    at /home/david/.cargo/registry/src/index.crates.io-6f17d22bba15001f/yazi-adaptor-0.2.5/src/ueberzug.rs:84

Describe the bug

When run in rxvt-unicode, after exiting yazi, the characters Gi=31,s=1,v=1,a=q,t=d,f=24;AAAA are left in the terminal.

Expected Behavior

No leftover characters from yazi after exiting.

To Reproduce

  • Install urxvt (sudo apt install rxvt-unicode)
  • Run rxvt-unicode
  • Run yazi
  • Press q to exit

Configuration

no config

Anything else?

"Unknown TERM: rxvt-unicode-256color" in yazi.log might be relevant.

@dtolnay dtolnay added the bug Something isn't working label May 11, 2024
@sxyazi
Copy link
Owner

sxyazi commented May 12, 2024

Thanks for the report!

It seems like urxvt doesn't recognize Kitty's graphics protocol detecting sequence, perhaps the easiest way to fix it is to add urxvt's TERM value rxvt-unicode-256color to the list of known terminals:

match term.as_str() {
"xterm-kitty" => return Self::Kitty,
"foot" => return Self::Foot,
"foot-extra" => return Self::Foot,
"xterm-ghostty" => return Self::Ghostty,
_ => warn!("[Adaptor] Unknown TERM: {term}"),
}

so further CSI process can be skipped. Would you like to raise a PR for it?

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 Jun 11, 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.

2 participants