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

Doesn't show content of file but return JavaScript source, Unicode text, UTF-8 text #106

Closed
ogios opened this issue May 13, 2024 · 5 comments

Comments

@ogios
Copy link

ogios commented May 13, 2024

image

but there is content in that file, i don't know why it happens to some specific file

@doronbehar
Copy link
Owner

Could you attach please an example file, or a link to such a file?

@doronbehar
Copy link
Owner

Yes so this is kind of by design like that. If you'd run file --mime-type on that file, you'd get:

javascript/application

Which doesn't has the text/ prefix. I'm not sure this default behavior should change, but that is open for discussion. You can use this line in your ~/.config/pistol/pistol.conf:

application/javascript bat --style=plain --paging=never --color=always %pistol-filename%

Where bat this project. The same goes for application/json files, as discussed in #34 .

Another improvement could be modifying the README to explain this behavior.

@ogios
Copy link
Author

ogios commented May 14, 2024

thanks, i understand it now.
and set cmd for specific type works

@ogios ogios closed this as completed May 14, 2024
@doronbehar
Copy link
Owner

Hey @ogios after having a 2nd thought on the subject, and reading this Q&A I decided to also make pistol read application/javascript files as if they were text files by default. You should be able to remove then the application/javascript line from your pistol.conf if you install the latest revision of pistol.

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