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

Improperly clearing escape codes from entries #658

Open
leo-arch opened this issue Dec 6, 2024 · 2 comments
Open

Improperly clearing escape codes from entries #658

leo-arch opened this issue Dec 6, 2024 · 2 comments

Comments

@leo-arch
Copy link

leo-arch commented Dec 6, 2024

skim isn't properly clearing up escape codes from entries passed to --preview via {}.

Skim version: 0.15.4

Steps to reproduce:

echo -e "\e[1;31mfile1\e[0m\0\e[31mfile2\e[0m\0\e[0mfile3\e[0m\0\e[2;32mfile4\e[0m\0" | sk --ansi --read0 --preview 'file -b {}'

Note that the output of file(1) for the entry file3 includes escape codes:

cannot open '\033[0mfile3\033[0m' (No such file or directory)

All these files (file[1-4]) are actually existent files, but file3 cannot be found due to embedded escape codes.

It seems to happen only with \e[0m (reset attribute) at the beginning of the entry (I've tried also with variants, like \e[0;0m, to no avail). Other color codes work as expected.

@LoricAndre
Copy link
Contributor

I was able to reproduce, thank you.
This will have to wait probably a few weeks though, unless you or someone else feels like opening a PR, as I have my hands very full atm with ratatui

@leo-arch
Copy link
Author

You're welcome @LoricAndre! Take your time. I just wanted to let you know. Once this is fixed, I'm considering adding skim as an alternative completion mechanism to clifm (which for the moment relies mostly on fzf).

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

No branches or pull requests

2 participants