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

Weird escape characters appearing in projectile index #1860

Open
antoniojkim opened this issue Aug 28, 2023 · 3 comments
Open

Weird escape characters appearing in projectile index #1860

antoniojkim opened this issue Aug 28, 2023 · 3 comments

Comments

@antoniojkim
Copy link

Expected behavior

Projectile index should contain valid paths to files in the project. It contained valid paths up until last week.

Actual behavior

After

Projectile is initializing cache for ...

Paths in index look like:

image

The path should just be src/infra/README.md, but there are evidently these escape characters included for some reason. These escape characters appear for every path in the index. These paths are obviously invalid and thus none of them open valid files and instead create new files with the messed up name

image image

Steps to reproduce the problem

The project I'm working on is remote and thus being accessed using TRAMP. All that needs to be done is initialize the project index and that's what I see.

This used to work without any problems up until last week. The only thing that's changed is I upgraded doomemacs to the latest. I've tried reverting the upgrade and still the issue persists. I've also tried downgrading to emacs 29.1 and still the issue persists.

Environment & Version information

Projectile version information

Projectile 2.8.0-snapshot

Emacs version

Emacs 30.0.50 (using emacs-plus@30 from homebrew and a customized doomemacs config)

Operating system

macOS 13.5.1 (22G90)

@antoniojkim
Copy link
Author

Manually running the fd command via ssh appears to return the proper file paths without the escape characters

$ ssh [server ip address] "cd [project path] && fd . -H --color=never --type file --type symlink --follow --exclude .git --strip-cwd-prefix" | grep "src/infra/README.md"
src/infra/README.md

So, nothing has changed from my device perspective I think. There must be some processing of the output of fd in projectile that is "inserting" or causing those escape characters to appear

@antoniojkim
Copy link
Author

Not sure why this only started appearing now, but I solved this by adding --color=never to the fd arg list,

(setq projectile-git-fd-args "-0 -H --color=never --type file --exclude .git --strip-cwd-prefix")

@nshankar
Copy link

Also saw this issue, the color=never flag solved it for me as well. Thanks @antoniojkim

noisycomputation added a commit to noisycomputation/doom-emacs that referenced this issue Oct 11, 2023
bbatsov/projectile@971cd5c4f25f -> batsov/projectile@d24b8173223f

The pinned `projectile` version erroneously calls `fd` without
explicitly disabling colors, which inserts color terminal codes
into filenames when used over `tramp`. This completely breaks
projectile over `tramp`.

The linked change adds `-c never` (shorthand form of `--color=never`)
to `projectile-git-fd-args`. This is the only change in `projectile`
between the two versions linked above, and it completely resolves
the issue.

Ref: bbatsov/projectile#1860
Ref: bbatsov/projectile#1859
noisycomputation added a commit to noisycomputation/doom-emacs that referenced this issue Oct 11, 2023
bbatsov/projectile@971cd5c4f25f -> bbatsov/projectile@d24b8173223f

The pinned `projectile` version erroneously calls `fd` without
explicitly disabling colors, which inserts color terminal codes
into filenames when used over `tramp`. This completely breaks
projectile over `tramp`.

The linked change adds `-c never` (shorthand form of `--color=never`)
to `projectile-git-fd-args`. This is the only change in `projectile`
between the two versions linked above, and it completely resolves
the issue.

Ref: bbatsov/projectile#1860
Ref: bbatsov/projectile#1859
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