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

Bad cursor position when terminal is resized while in alternate mode #1512

Closed
Canop opened this issue Jan 6, 2022 · 3 comments
Closed

Bad cursor position when terminal is resized while in alternate mode #1512

Canop opened this issue Jan 6, 2022 · 3 comments
Labels
bug Something isn't working fixed-in-nightly This is (or is assumed to be) fixed in the nightly builds.

Comments

@Canop
Copy link

Canop commented Jan 6, 2022

What Operating System(s) are you seeing this problem on?

Linux X11

WezTerm version

20220105-201556-91a423da

(built from source, up to date)

Describe the bug

The terminal isn't restored into a consistent state on leaving alternate mode when it was resized while in alternate. It looks like the new line with the prompt and the cursor isn't at a proper location.

Before launching neovim:

image

After resizing and leaving neovim:

image

(:e is the shortcut I used to launch neovim)

To Reproduce

  1. launch a program running in alternate, for example neovim
  2. resize the WezTerm terminal
  3. quit the program (thus leaving the alternate screen)
  4. the prompt and cursor are drawn at a wrong position

Expected Behavior

The terminal should be restored with a consistent state, no text line written below the cursor's line.

Logs

10:02:36~/dev/wezterm target/release/wezterm
2022-01-06T09:02:37.625Z INFO wezterm_mux_server_impl::local > setting up /run/user/1000/wezterm/gui-sock-23697
2022-01-06T09:02:37.722Z INFO wezterm_gui::termwindow > OpenGL initialized! GeForce GTX 670/PCIe/SSE2 4.6.0 NVIDIA 418.211.00 is_context_loss_possible=false wezterm version: 20220105-201556-91a423da
2022-01-06T09:02:49.653Z WARN wezterm_term::terminalstate > unhandled DecPrivateMode SetDecPrivateMode(Unspecified(1015))
2022-01-06T09:02:49.653Z WARN wezterm_term::terminalstate > unhandled DecPrivateMode ResetDecPrivateMode(Unspecified(1015))

Anything else?

This bug appears in some other terminals (for example Kitty) but neither in Gnome's terminal nor in Terminator.

@Canop Canop added the bug Something isn't working label Jan 6, 2022
@wez
Copy link
Owner

wez commented Jan 8, 2022

I think I see what you mean: it looks like the cursor position on the primary screen isn't correctly updated for the resize while the alt screen is active. I've pushed a commit that tackles that, and things look a bit nicer.
Can you confirm that this addresses what you were seeing when you next have a few moments?
Thanks!

@wez wez added the fixed-in-nightly This is (or is assumed to be) fixed in the nightly builds. label Jan 8, 2022
@Canop Canop changed the title Bad terminal cleaning when terminal is resized while in alternate mode Bad cursor position when terminal is resized while in alternate mode Jan 8, 2022
@Canop
Copy link
Author

Canop commented Jan 8, 2022

@wez it's good now!

@Canop Canop closed this as completed Jan 8, 2022
@github-actions
Copy link

github-actions bot commented Feb 4, 2023

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working fixed-in-nightly This is (or is assumed to be) fixed in the nightly builds.
Projects
None yet
Development

No branches or pull requests

2 participants