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

Extra Character Row for full Screen TUIs ("Scroll 0/1") #952

Closed
KyleKing opened this issue Dec 18, 2021 · 4 comments · Fixed by #1032
Closed

Extra Character Row for full Screen TUIs ("Scroll 0/1") #952

KyleKing opened this issue Dec 18, 2021 · 4 comments · Fixed by #1032

Comments

@KyleKing
Copy link

Description

When launching a full screen TUI in Zellij, the screen itsefl scrolls, when it should have a 100% fill. This doesn't appear to be terminal emulator or library-specific because I tried TUI applications implemented in several languages (bpytop, lazygit, htop, etc.) in iTerm2 and Alacritty

Further information

To reproduce, launch zellij, launch any fullscreen TUI (i.e. lazygit or htop), then attempt to scroll and you should see the whole interface move up or down one row when it instead should fill the screen and not move

Demo with asciinema:

asciicast

Logs from testing with lazygit:

zellij-11.log
zellij.log

Device information

zellij --version: zellij 0.22.1
tput lines: 58
tput cols: 192
uname -av or ver(Windows): Darwin MacBook-Pro.local 19.6.0 Darwin Kernel Version 19.6.0: Sun Nov 14 19:58:51 PST 2021; root:xnu-6153.141.50~1/RELEASE_X86_64 x86_64
alacritty --version: alacritty 0.9.0 (fed349a)
lazygit --version: commit=, build date=, build source=homebrew, version=0.31.4, os=darwin, arch=amd64
(Reproducible in latest versions of iTerm2 or Kitty and with htop, bpytop, etc.)

Experimentation

I tried: zellij options --no-pane-frames and/or the most generic layout possible and the error persisted:

---
template:
  direction: Horizontal
  parts:
    - direction: Vertical
      no_pane_frames: true
@KyleKing
Copy link
Author

KyleKing commented Dec 23, 2021

This is a blocker for me, so tried to take a look in more depth

This regression appears to be introduced in Zellij 0.18 and isn't present in 0.17 or 0.16. I think it might be related to this change (fb8e44b), but I don't know Go (Rust 😆) or the codebase. This was the full diff between releases: 1868816...50452b5

I'm trying out a fork now locally, but not sure how far I can get

@KyleKing
Copy link
Author

KyleKing commented Dec 23, 2021

Okay, so reverting fb8e44b by restoring self.viewport.clear() fixes this issue, but is counter to the changes requested in #743. Maybe there needs to be separate logic for a full viewport clear vs. only clear-screen.

Relevant function:

pub fn fill_viewport(&mut self, character: TerminalCharacter) {
let row_count_to_transfer = self.viewport.len();
let transferred_rows_count = transfer_rows_from_viewport_to_lines_above(
&mut self.viewport,
&mut self.lines_above,
row_count_to_transfer,
self.width,
);
self.scrollback_buffer_lines =
subtract_isize_from_usize(self.scrollback_buffer_lines, transferred_rows_count);
for _ in 0..self.height {
let columns = VecDeque::from(vec![character; self.width]);
self.viewport.push(Row::from_columns(columns).canonical());
}
self.output_buffer.update_all_lines();
}

Regardless, there is still an issue with scrolling that prevents use of most TUIs (which I think is being addressed in #624)

@tlinford
Copy link
Contributor

@KyleKing you were spot on, hope to get this sorted pretty soon

@tlinford
Copy link
Contributor

tlinford commented Feb 2, 2022

fixed in #1032

@tlinford tlinford closed this as completed Feb 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants