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

Binary output written to console #217

Closed
mgeisler opened this issue Feb 15, 2019 · 5 comments
Closed

Binary output written to console #217

mgeisler opened this issue Feb 15, 2019 · 5 comments
Labels
not a bug Not a bug in chezmoi

Comments

@mgeisler
Copy link
Contributor

If you track binary files with Chezmoi, you will see binary output in the termianl when using chezmoi update -v.

I suggest checking if the files contain a NUL byte before printing them to the terminal. That heuristic normally works okay to determine if a file is "binary" or not.

@twpayne twpayne added the bug Something isn't working label Feb 15, 2019
@twpayne
Copy link
Owner

twpayne commented Feb 15, 2019

This isn't supposed to happen. There's a check for whether a file is binary or not before printing the diff. Obviously it's not working. What are the contents of the binary file that's getting printed? A hex dump of the first 512 bytes should be enough for reproducing this bug.

@twpayne
Copy link
Owner

twpayne commented Feb 15, 2019

Relevant commit is f2dfbb8#diff-8e160c67b78164a82112c7af4beb91fe.

@mgeisler
Copy link
Contributor Author

Oh, I see you're already thought of this! Cool :-)

The files in question were fonts -- Inconsolata Regular and Bold taken from https://fonts.google.com/specimen/Inconsolata.

@mgeisler
Copy link
Contributor Author

I tried running http.DetectContentType on the first 512 byte of the font, and it answers font/ttf as one would hope: https://play.go-lang.com/p/SQdUxpt0x1E

So I don't know why the font was shown in the terminal.

@twpayne
Copy link
Owner

twpayne commented Feb 17, 2019

Thanks very much for doing the further investigation. I'll close this for now until we can reproduce the problem.

@twpayne twpayne closed this as completed Feb 17, 2019
@twpayne twpayne added not a bug Not a bug in chezmoi and removed bug Something isn't working labels Feb 17, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
not a bug Not a bug in chezmoi
Projects
None yet
Development

No branches or pull requests

2 participants