Skip to content

Prevent QuitSmall from truncating no-wrap output - #1211

Open
chapmanjacobd wants to merge 2 commits into
noborus:masterfrom
chapmanjacobd:fix/quit-small-no-truncation
Open

chapmanjacobd wants to merge 2 commits into
noborus:masterfrom
chapmanjacobd:fix/quit-small-no-truncation

Conversation

@chapmanjacobd

@chapmanjacobd chapmanjacobd commented Oct 23, 2026 •

Copy link
Copy Markdown

Problem

With QuitSmall enabled and wrapping disabled, docSmall only checked the rendered height but not width. A single line wider than the terminal was therefore treated as fitting on one screen, and the automatic exit path wrote only the clipped current screen. I can't think of a situation where I as a user would prefer this behavior so I am pretty sure this is unintended. A bug. But if not, I could change it to a config option... maybe QuitSmallNoWrap?

Fix

Keep ov open when no-wrap content exceeds the available body width. This lets users scroll horizontally instead of losing text. Wrapped output keeps the existing height-based behavior.

Validation

  • go test ./...
  • go vet ./...
  • Tested against various text files that I have

When wrapping is disabled, QuitSmall previously considered a long line to fit because it only compared rendered height. It then wrote the clipped current screen on exit. Keep the viewer open whenever no-wrap content exceeds the available width.
@noborus

noborus commented Oct 24, 2026

Copy link
Copy Markdown
Owner

Thank you for the report and for taking the time to investigate this behavior.

I think the current behavior is intentional. With --wrap=none, QuitSmall checks whether the content fits vertically, not whether every line fits horizontally. This can be useful when only the visible part of a long line matters—for example, ps u | ov -F --wrap=none, where the command’s trailing options may not be needed. If users want to inspect the rest of a long line, they can omit -F and scroll horizontally.

IsWriteOriginal also lets users choose whether the exit output uses the original text or the current screen. Given these use cases, I’d prefer to keep the current behavior rather than prevent QuitSmall from exiting when a line is wider than the screen. Thanks again for raising the issue.

@noborus

noborus commented Nov 5, 2026

Copy link
Copy Markdown
Owner

I understand the fix, but I'm not sure when this option would be needed. Could you explain the use case?

@noborus noborus closed this Nov 5, 2026
@noborus noborus reopened this Nov 5, 2026
@chapmanjacobd

Copy link
Copy Markdown
Author

Sure... The use case is that you like the default of

QuitSmall: true
General:
Wrap: "none"

And you're running a command that takes a long time and/or can only be run once and you want to see the output in a pager. Losing the information by default is unexpected as someone who would often run less -FSRX

This branch has not been deployed

No deployments
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.

2 participants