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

Full-screen Display on windows goes off by one line #963

Closed
jvalkeal opened this issue Apr 13, 2024 · 3 comments · Fixed by #966
Closed

Full-screen Display on windows goes off by one line #963

jvalkeal opened this issue Apr 13, 2024 · 3 comments · Fixed by #966
Milestone

Comments

@jvalkeal
Copy link
Contributor

jvalkeal commented Apr 13, 2024

In spring-shell with full-screen terminal app(on windows) I noticed an issue [1041] that there is extra line break thus causing lines to go vertically off by one line. This essentially makes first line scroll out and extra empty line at a bottom. Linked issue has screenshots which probably makes it more clear than what I tried to describe above. It does't matter which combination is used cmd/powershell and jna/jansi.

Looks to be caused by:

if (this.wrapAtEol) {
terminal.writer().write(" \b");
cursorPos++;

I did some experiments by forking Display class to try out some fixes and something like this seems to work.

if (this.wrapAtEol) {
    if (fullScreen && lineIndex < numLines) {
        terminal.writer().write(" \b");
        cursorPos++;
    }
}

I started to read what terminal caps eat_newline_glitch and auto_right_margin mean and now I'm not sure if my proposed fix would be good enough to PR it. While this look to fix my issue I'm wondering if it's a generic fix. Writing space and backspace looks to go back to issue [123].

I was reading https://stackoverflow.com/questions/31360385/an-obscure-one-documented-vt100-soft-wrap-escape-sequence and it gets awfully complex around line breaks.

[1041] spring-projects/spring-shell#1041
[123] #123

@gnodet
Copy link
Member

gnodet commented Apr 17, 2024

Yes, line breaks are a mess :-(

@jvalkeal
Copy link
Contributor Author

Would you like me to PR this change?

@gnodet
Copy link
Member

gnodet commented Apr 17, 2024

Yes, the space + backspace think should not be done on the last line I think, or at least, not when running in a fullscreen application mode, where you don't really want the screen to scroll at all.

jvalkeal added a commit to jvalkeal/jline3 that referenced this issue Apr 17, 2024
- This fixes issue in Display which should not
  do a line break on fullscreen mode for a last
  line causing scrolling and making screen of
  by one line.
- Fixes jline#963
gnodet pushed a commit that referenced this issue Apr 17, 2024
- This fixes issue in Display which should not
  do a line break on fullscreen mode for a last
  line causing scrolling and making screen of
  by one line.
- Fixes #963
@gnodet gnodet added this to the 3.26.0 milestone Apr 17, 2024
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 a pull request may close this issue.

2 participants