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

print last line when cat-ting interactively #78

Merged
merged 1 commit into from
Sep 8, 2024
Merged

Conversation

wolfv
Copy link
Member

@wolfv wolfv commented Sep 8, 2024

If the file does not end with a newline, the last line was swallowed.

This mimicks what cat on macOS is doing by printing a %\n at the end of cat'ting when in interactive mode. On macOS this is a white-on-black percentage sign, which would be a small improvement.

Not sure if theoretically this should be handled by the shell or cat, though.
In order to implement this on the shell level we would need to redirect the stdout stream and inspect it.

Copy link
Collaborator

@certik certik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is fine for now. It's not tested however which will eventually become a problem: #82.

@Hofer-Julian Hofer-Julian merged commit af25f25 into main Sep 8, 2024
4 checks passed
@Hofer-Julian Hofer-Julian deleted the fix-cat-last-line branch September 8, 2024 18:23
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 this pull request may close these issues.

3 participants