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

Weird behavior when forking helix to background #6149

Closed
mWalrus opened this issue Mar 1, 2023 · 5 comments · Fixed by #6170 or #6194
Closed

Weird behavior when forking helix to background #6149

mWalrus opened this issue Mar 1, 2023 · 5 comments · Fixed by #6170 or #6194
Assignees
Labels
C-bug Category: This is a bug

Comments

@mWalrus
Copy link
Contributor

mWalrus commented Mar 1, 2023

Summary

Helix behaves weird when forking the process to the background (Ctrl+Z) and sending it to the foreground (fg) on Linux on latest git version.

Reproduction Steps

I tried this:

  1. hx
  2. Ctrl+Z
  3. fg

I expected this to happen:
It should fork the helix process to the background when I Ctrl+Z and resume the process when I send it to the foreground with fg.

Instead, this happened:
When trying to fork to the background, nothing happens the first time. The second time it works as expected.

When trying to send it to the foreground, it clears the terminal window on the first attempt. When trying again it brings the editor back, but it takes a second or two for the TUI to display.

If I quit helix after this, ^[[?6c is present in my terminal after my terminal prompt, which seems to have been produced after the second attempt to resume the process.

Helix log

Nothing since I updated.

Platform

Arch Linux

Terminal Emulator

Alacritty

Helix Version

helix 22.12 (c082ef2)

@mWalrus mWalrus added the C-bug Category: This is a bug label Mar 1, 2023
@santiagovrancovich
Copy link
Contributor

I'm having the same issue, i would also like to add that i've tested it with gnome-console and tty, the issue persists, but the string of character left behid is different in each instance, with gnome-console is 65;1;9c and with the tty is just 6c

@the-mikedavis
Copy link
Member

It looks like the query to check keyboard enhancement protocol support times out and fails causing the lag and failure to restore the terminal. We should cache the value for keyboard enhancement support when we first query it instead of re-checking it anyways and that will fix this

@mWalrus
Copy link
Contributor Author

mWalrus commented Mar 5, 2023

This mostly works now although there are still some issues. The escape sequence characters are sometimes still present in the terminal after C-z, and resuming the process again is still slow (around 2+ seconds).

@the-mikedavis
Copy link
Member

Ah yeah I can reproduce that. It doesn't happen every time but sometimes continuing the process leads to the same lockup. #6160 should solve this consistently but a proper fix is also necessary upstream in crossterm.

@gyreas
Copy link

gyreas commented Mar 5, 2023

I get this issue too even tho enhanced keyboard protocol is enabled (and works fine?) And runs in Kitty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment