liamg / darktile

:waning_crescent_moon: Darktile is a GPU rendered terminal emulator designed for tiling window managers.
MIT License
3.04k stars 112 forks source link

Duplicated lines in backscroll when resizing the Aminal window #270

Closed vadymeng0 closed 3 years ago

vadymeng0 commented 5 years ago

When resizing the Aminal window, it looks like some lines on the top of the terminal buffer are doubling so that it is possible to scroll the window up and see the duplicates. The number of doubled lines seems to depend on how small the window is made. This behavior is reproduced on Windows, and not on Debian. Not tested on MacOS.

To Reproduce Steps to reproduce the behavior:

  1. Run Aminal as usual. The two-lines greeting message from Windows cmd.exe will be displayed.
  2. Try to scroll the window with the mouse wheel. It shouldn't scroll (because there are no scrollback lines)
  3. Resize the Aminal's window to make it display less than 10 lines. The two-lines greeting message should be still on the screen.
  4. Try to scroll the window with the mouse wheel again. The window will be scrolled showing duplicate lines.

Expected behavior There must be no duplicate lines on resizing the window.

Environment (please complete the following information):

vadymeng0 commented 5 years ago

So, it looks like that, with current ConPTY implementation it is not possible to correctly handle resizing of the window when backscroll is enabled. This is because right after resizing, the system tries to re-draw the screen by sending the whole contents of the pseudo console, line by line, even after the window is actually resized.

See this issue for additional info: https://github.com/Microsoft/console/issues/383

rrrooommmaaa commented 5 years ago

@nikitar020 In develop branch, there is a method (pty *winConPty) Clear() that shows how to fill the output screen buffer with arbitrary data. It fills it with "emptiness" but you can write a method that fills with appropriate data that should be there after resizing.

liamg commented 3 years ago

Closed due to complete rewrite as part of bringing the project back to life, please create a new issue if still relevant. Thank you!