QQxiaoming / quardCRT

Your All-in-One Tool for Terminal Emulation and Remote Desktop
https://quardcrt.rtfd.io
GNU General Public License v3.0
58 stars 5 forks source link

working vim in an ssh2 session, terminal screen does not update properly. #40

Closed letsview closed 2 months ago

letsview commented 3 months ago

Describe the bug After working with vim in an ssh2 session and exiting, the terminal screen does not update properly.

To Reproduce Steps to reproduce the behavior:

  1. Connect to other Linux with SSH2 session.
  2. Go to anywhere
  3. Exit after editing text file with VIM.
  4. Type 'Enter' command continuously on shell.

Expected behavior The screen should be neatly updated.

Screenshots image

Desktop (please complete the following information):

Additional context

QQxiaoming commented 2 months ago

I tried many times but failed to reproduce this issue. I guess it might be caused by broken window resize. Have you tried to resize the window after this error occurs? What happens?

letsview commented 2 months ago

The problem is solved by opening the text file with VIM and then adjusting the window size. As shown in the following image, the size of the editing window when opening a document with VIM for the first time seems to be related. image

QQxiaoming commented 2 months ago

The problem is solved by opening the text file with VIM and then adjusting the window size. As shown in the following image, the size of the editing window when opening a document with VIM for the first time seems to be related. image

I think my latest commit ea773b2 may have fixed this issue. The original logic was to use a fixed terminal size of 80x24 after establishing the ssh connection, and resize sshpty according to the window size after 100ms. However, if the link establishment time is greater than 100ms, the resize will be ignored, resulting in the final size staying at 80x24, which is exactly the same as the situation in the screenshot. ea773b2 has now fixed this problem and will use the correct window size when initializing the connection.

Before,

https://github.com/QQxiaoming/quardCRT/blob/0315f435c173fb558b1663e7f2bb45c6a16c5575/lib/qtssh/sshshell.cpp#L119 https://github.com/QQxiaoming/quardCRT/blob/0315f435c173fb558b1663e7f2bb45c6a16c5575/src/sessionswindow/sessionswindow.cpp#L335-L337

Now,

https://github.com/QQxiaoming/quardCRT/blob/ea773b20ce6f54943f0b562498eb23563e7ba21f/lib/qtssh/sshshell.cpp#L121

If you are interested you can try the artifacts in the github action workflow, or wait for my next release. Thank you for your contributions to make quardCRT better!

QQxiaoming commented 2 months ago

V0.4.7 is now available, which should resolve this issue.