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

Explicit size specification needed when redirecting output #92

Open
nielsbasjes opened this issue Dec 1, 2020 · 6 comments
Open

Explicit size specification needed when redirecting output #92

nielsbasjes opened this issue Dec 1, 2020 · 6 comments
Labels
bug Something isn't working

Comments

@nielsbasjes
Copy link

I would like to have the option to write the ASCII with escape codes and all to a file in such a way that at a later moment I can simply do cat file.ans and see the image.

@nielsbasjes
Copy link
Author

NOTE: I tried to simply redirect the output to a file which resulted in a 0 bytes file.

@stefanhaustein
Copy link
Owner

stefanhaustein commented Dec 6, 2020

Redirection should work... Perhaps something trivial is missing such as flushing the output stream...?

On which platform did you encounter this problem?

@stefanhaustein stefanhaustein changed the title Feature request: Write to file Redirection to file results in 0 byte file Dec 6, 2020
@stefanhaustein
Copy link
Owner

p.p.s: Did you try with an explicit size? I think a problem might be failure to detect the terminal size?

@clort81
Copy link

clort81 commented Jan 3, 2021

Redirecting to file works fine here. Be sure to specify a -w width and a -h larger than required.

e.g. tiv -w 80 -h 400 mypic.png > mypic.ans && cat mypic.ans

@nielsbasjes
Copy link
Author

Sorry for the late reply.
Yes, the redirect with the -h and -w works like a charm.
Thanks.

Perhaps it is useful having this in the readme?
Or a helpful message to stderr in case of the 0 bytes situation?

@stefanhaustein
Copy link
Owner

I think we could check whether the value is reasonable if there is no explicit width, and use a default value if not

@stefanhaustein stefanhaustein changed the title Redirection to file results in 0 byte file Explicit size specification needed when redirecting output Aug 13, 2021
@aaronliu0130 aaronliu0130 added the bug Something isn't working label Jun 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants