Skip to content

Bug Report: File name too long Error in Yazi Home Manager #6724

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

Closed
phucleeuwu opened this issue Mar 29, 2025 · 4 comments
Closed

Bug Report: File name too long Error in Yazi Home Manager #6724

phucleeuwu opened this issue Mar 29, 2025 · 4 comments

Comments

@phucleeuwu
Copy link

Summary

When enabling Fish shell integration for Yazi in Home Manager with the following configuration:

programs.yazi = {
  enable = true;
  enableFishIntegration = true;
  shellWrapperName = "y";
};

the following error occurs:

cd: File name too long
cd: Unknown error trying to locate directory
“───────┬────────────────────────────────────────────────────────────────────────
        │ File: /var/folders/xx/rkm835zx78b4z1n3_wbxv6ww0000gn/T/yazi-cwd.XXX
        │ XX.huRUF8y1j5
        │ Size: 42 B
───────┼────────────────────────────────────────────────────────────────────────
    1   │ /Users/phuc/nixos-config/.github/workflows
───────┴────────────────────────────────────────────────────────────────────────”

Steps to Reproduce

  1. Enable Yazi in Home Manager with Fish integration and set shellWrapperName = "y";.
  2. Open a Fish shell and y to use yazi.
  3. Try to go into a different directory with Yazi.
  4. After exit yazi observe the error message regarding file name length.

Expected Behavior

  • The cd command should function correctly without errors.
  • The integration should not create an excessively long or malformed path.

Actual Behavior

  • cd fails with a File name too long error.
  • The path appears to be improperly formatted and overly long.

System Information

  • OS: macOS (Darwin)
  • Shell: Fish
  • Home Manager: Latest with Nix-Darwin modules
  • Yazi Version: Latest

Additional Notes

  • This issue does not occur when enableFishIntegration = false;.
  • Other shells (e.g., Zsh, Bash) may not exhibit the same issue.
  • The error suggests a problem with how Yazi writes its temporary directory or handles Fish integration.

Possible Workarounds

  • Disabling Fish integration temporarily.
  • Using a different shellWrapperName.

Suggestions for Fix

  • Investigate how Yazi manages the Fish shell wrapper and its temporary files.
  • Check if yazi-cwd.XXX is being generated correctly.

Any insights or fixes would be appreciated!

@phucleeuwu phucleeuwu changed the title Bug Report: enableFishIntegration = true; Causes File name too long Error in Yazi Home Manager Bug Report: File name too long Error in Yazi Home Manager Mar 31, 2025
@khaneliman
Copy link
Collaborator

Thanks for a well defined bug report, I don't use fish atm. But, if no one gets to it and I find time. I can try looking into it.

@phucleeuwu
Copy link
Author

phucleeuwu commented Apr 1, 2025

Thanks for a well defined bug report, I don't use fish atm. But, if no one gets to it and I find time. I can try looking into it.

Maybe yazi shell wrapper is implement wrong in home manager

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

@phucleeuwu
Copy link
Author

yazi shell wrapper should be XXXXXX 6X not 5X like home manager config

@phucleeuwu
Copy link
Author

fixed in #6817

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

Successfully merging a pull request may close this issue.

2 participants