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

ov -F not auto add LF if the last line of file do not has LF #510

Open
charlie-wong opened this issue Mar 30, 2024 · 4 comments
Open

ov -F not auto add LF if the last line of file do not has LF #510

charlie-wong opened this issue Mar 30, 2024 · 4 comments
Labels
question Further information is requested

Comments

@charlie-wong
Copy link

charlie-wong commented Mar 30, 2024

  • ov version v0.33.3 rev:a5e120e
  • Reproduce
    User@Server $ echo -n ok > ok.log
    User@Server $ hexyl ok.log
    ┌────────┬─────────────────────────┬─────────────────────────┬────────┬────────┐
    │00000000│ 6f 6b                   ┊                         │ok      ┊        │
    └────────┴─────────────────────────┴─────────────────────────┴────────┴────────┘
    User@Server $ less -F ok.log # auto append LF
    ok
    User@Server $ ov -F ok.log # do not append LF, after enter, result is
    okUser@Server $ # <--- this is not that good!
@noborus
Copy link
Owner

noborus commented Mar 31, 2024

Thank you for the issue.

That's certainly how it works. However, I am not convinced that adding LF is correct.
What kind of problems will occur?

@charlie-wong
Copy link
Author

Yes, just add LF is not right, it should be related to the OS

But when it works with git log, no auto line-feed will make output not good, like

User@Server $ git log --format=format:'%C(red)%h %C(green)%as %C(reset)%s' -2
d85af43 2024-03-24 docs: add README
64abd80 2024-03-24 docs: add .gitignoreUser@Server $ 

@noborus
Copy link
Owner

noborus commented Apr 2, 2024

thank you for your reply.

It seems correct to use tformat in the example you mention.

git log --format=tformat:'%C(red)%h %C(green)%as %C(reset)%s' -2

The current behavior is the same as --no-pager.
I still don't think this behavior should be the same as less.

@charlie-wong
Copy link
Author

ok, got it!

@noborus noborus added the question Further information is requested label Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants