possible text wrapping issue with console width less than 102 characters. #175
Labels
No Label
blocked
bug
build
documentation
duplicate
enhancement
finger
gemini
gopher
help wanted
http
in progress
invalid
local
needs-info
non-code
non-functional
non-urgent
question
release
rendering
suggestion
telnet
terminal
urgent
wontfix
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sloum/bombadillo#175
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A possible text wrapping issue when browsing documents in any protocol, affecting the second line onward. The second-last character is not printed, replaced with the following character instead.
With the terminal at 80x24 size, go to a page that is not preformatted to 80 chars. I first saw this on the following page: gemini://gemini.circumlunar.space:1965/servers/
The text appears as:
Expand the console window to greater than 102 characters width to see the content correctly displayed.
I have replicated this. I am always on a full screen terminal so this just slipped past me it seems. I tried in st and in gnome-term and the issue was present for both, though st actually did not do a proper wrap at all at that size. This is a weird one. I'll pause my work on the in-app help and switch over to this tomorrow.
Thanks for the report @asdf
I think there is a line overflow happening where it is writing more than the width of the screen. For terminals that support turning line wrapping off (gnome-term, for example) this causes an overwrite to occur (I think). For terminals that do not support it (st, for example), breakage will happen to the wrapping. I'll update to see if wrapping to 1 less than the terminal width solves the issue.
Trying to debug this and loving life.
This is the test I'm trying:
So to clarify, the test input I can see in
p.RawContent
is:From this, I think the expected result of
p.WrappedContent
should be:But the actual result is:
So the second line onward is being created as width + 1?
When a line wraps, the counter is set to 0 and then a character is written. If the counter is set to 1 instead, the expected result is received and it works in Gnome Terminal (but st is printing blank instead of the final character, perhaps this is a different issue with the terminal wrap option?).
I don't really understand this, like it's hard to comprehend even watching it go through the debugger one loop at a time. But maybe it is on the right track?
The issue appears to be that when a line is wrapped, the counter is reset to 0 and a character is written but we do not increment the counter as would be required normally when a character is written. As a result, lines that are wrapped are one character longer than requested. I've submitted #176 to work this through.
Just a note for reference: this was a lot easier to comprehend after a break and also by reducing the size of the test data (e.g. debugging with a 2 character line width).
This has been merged into a release branch. I will close this out once it is released into
develop
.Closing now since this has been merged into
develop
.