-
Notifications
You must be signed in to change notification settings - Fork 27
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
helix job control freezes murex #863
Comments
this appears to be related, from another Go based shell, but with Vim: elves/elvish#988 |
as per that thread, also partly helix's fault, I guess? helix-editor/helix#3321 |
I’ve been looking into this more general issue off and on for a while now. I think you’re definitely right that it’s something to do with how Go. I think the issue resides in how it’s forking processes so it isn’t attaching a group ID correctly so when the stop signal is being sent it’s not getting handled correctly. It’s generally not a problem but if a terminal program reads from stdin, it’s looking like both murex and the child process are fighting to read from it. I’m back from holiday soon so in a couple of days I can spend some proper time reinvestigating this. Also thank you for the detailed bug report and research. It’s really useful. |
The issue does appear to be related to Murex not creating a new PGID. Technically Helix shouldn't be listening for I've spent a couple of days refactoring and rewriting the job control logic (PR: #865) Helix now doesn't stop Murex when Helix receives a The PR has also only been tested on macOS. The code should work with all Unixes and Linux too, but I haven't tested them. The code will fail to even compile on non-POSIX platforms because I haven't yet written any handling code for Windows, WASM nor Plan 9. It might take a few more days to get the PR code into a usable state just of macOS. But there's at least progress happening. |
The SID theory was incorrect, though not helped by what appears to be a bug in I've now got a working prototype pushed to |
I tested the
The above usually takes 2 cycles to break, but varies - so slightly non deterministic but consistently reproducible |
I’m seeing some show stopper bugs around different TTYs too. This fix definitely breaks more things than it fixes. What happens if you run the following as your first command on the shell?
? This forces Murex to assign “real” posix TTYs to processes rather than fake ones that Murex owns. So you lose things like stderr being highlighted red, but it’s plays nicer with posix standards. If you can try that with the branch release please (it’s currently the only version that sets PGID). |
Similar behavioural loop up to 3.a, but it no longer gets stuck in raw mode ignoring input. Newlines and cursors break, but I can still interact with murex. |
Awesome. That helps a lot. I'll investigate further. Thank you |
@atagen I've been a little quiet because I haven't really had enough time to focus on this problem again. Until today. I think I might have cracked it. However there are a couple of caveats:
Despite all these caveats, as long as Murex is your terminal's shell, everything should work transparently. If it's going to work on Linux as well, that is. |
So it seems to be working for macOS (iTerm) but still hanging on Linux with Konsole and Kitty. Even more curiously, it's failing in different ways in Konsole vs Kitty. Working with TTY's is "fun" |
Update: The solution I've landed on is the following:
I'm not sure when I'll get chance to do some proper debugging in Linux. I do have Linux systems to test Murex on, but this is a problem I really need several hours of uninterruptible time if I'm going to properly crack it. So it might be a few more weeks before it's fully solved. |
I might have spoken too soon when I said it would be a few more weeks. I think I've nailed it. Works on both macOS and Linux now -- for me at least. Tested in a couple of terminal emulators too. Can you have a moment, can you give this a try too please |
@atagen I'll done some more testing at it's definitely working across the various different systems (Linux and Windows, iTerm2, Kitty, Konsole) I have. So I'll be looking to release the current build tonight. It's possible there might still be some edge cases where things fail, there's so many different configurations and implementations of terminal emulators and TTYs that there'll inevitably be edge cases. So I'll keep this issue open for a little while longer in case you run into further problems. |
seems to be working fine so far - the only hiccup I've had is when opening helix in a TTY it only takes up 3/4 of my screen for some reason, but that's a different issue and hardly a dealbreaker. daily driving murex now, thanks for your very committed support :) |
@atagen You are very welcome. It'd be interested to know more about the 3/4 issue. At first guess, Helix isn't able to get the TTY size so it is defaulting to 80x25. If I recall correctly, the syscall to do that can be a bit unreliable. |
Describe the bug:
while using helix editor, trying to background the process with ctrl+z results in murex freezing completely; the terminal buffer is flipped back but any input is simply echoed. killing the helix process has no effect.
Expected behaviour:
helix is suspended, murex provides a shell, helix is resumable
Screenshots:
If applicable, add screenshots to help explain your problem.
Platform (please complete the following information):
uname -a
if supported:Linux quiver 6.10.5-xanmod1 #1-NixOS SMP PREEMPT_DYNAMIC Tue Jan 1 00:00:00 UTC 1980 x86_64 GNU/Linux
version --no-app-name
: 6.2.4000The text was updated successfully, but these errors were encountered: