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

Writes are interrupted when suspending #10765

Closed
PotatoesFall opened this issue May 15, 2024 · 5 comments · Fixed by #10797
Closed

Writes are interrupted when suspending #10765

PotatoesFall opened this issue May 15, 2024 · 5 comments · Fixed by #10797
Labels
A-helix-term Area: Helix term improvements C-bug Category: This is a bug E-easy Call for participation: Experience needed to fix: Easy / not much E-good-first-issue Call for participation: Issues suitable for new contributors

Comments

@PotatoesFall
Copy link
Contributor

Summary

First of all thank you to everybody who has been working on this fantastic editor ❤️

When I save a file in the editor (usually using Space-W), and then immediately suspend (using C-z), the file is sometimes not written. Only when I then use fg to resume helix, is the file saved.

Since suspending is a big part of my workflow, this has messed me up countless times because my recent changes weren't working (because they weren't saved)

It would be awesome if any save actions are still executed even if helix is suspended. Is that possible?

Reproduction Steps

I tried this:

  1. hx {file}
  2. make changed
  3. :w
  4. C-z
  5. check if file was saved

I expected this to happen:

File was saved with new changes

Instead, this happened:

File was not saved

Helix log

~/.cache/helix/helix.log
2024-05-15T17:38:32.021 helix_core::syntax [ERROR] TS parser failed, disabling TS for the current buffer: Err(Cancelled)

Platform

Fedora Linux 39

Terminal Emulator

alacritty 0.13.2

Installation Method

source

Helix Version

helix 24.3 (2cadec0)

@PotatoesFall PotatoesFall added the C-bug Category: This is a bug label May 15, 2024
@the-mikedavis
Copy link
Member

C-z (the suspend command) raises SIGTSTP and stops the process so I don't believe we can continue to write in the background. We could block on any writes before raising the signal though, like how we block on writes in :quit

@PotatoesFall
Copy link
Contributor Author

I think that would be a huge improvement!

One thing to add, I'm pretty sure this is only happening for my .go files. On save there is autoformatting (gofmt/goimports) happening, causing a small delay. I was not able to replicate this with a simple text file. I assume that the time taken for autoformatting is long enough for this to happen reliably, while for normal saves it's not a problem.

I think a lot of people are using autoformat on save, and go has a fairly fast toolchain for that. I imagine I'm not the only one with this problem, although I haven't been able to find any other reports of this issue.

@kirawi kirawi added E-easy Call for participation: Experience needed to fix: Easy / not much A-helix-term Area: Helix term improvements E-good-first-issue Call for participation: Issues suitable for new contributors labels May 18, 2024
@lpoirothattermann
Copy link

@PotatoesFall can you try my commit, let me know if it's working as expected.

@PotatoesFall
Copy link
Contributor Author

Hey @lpoirothattermann thanks so much for taking the time to help out!

I feel it's rude to just make another MR while yours is active but I saw there was some criticism on your MR and I had some time today and wanted to take a stab at this myself. Apologies.

@lpoirothattermann
Copy link

Hey @lpoirothattermann thanks so much for taking the time to help out!

I feel it's rude to just make another MR while yours is active but I saw there was some criticism on your MR and I had some time today and wanted to take a stab at this myself. Apologies.

No problem :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-helix-term Area: Helix term improvements C-bug Category: This is a bug E-easy Call for participation: Experience needed to fix: Easy / not much E-good-first-issue Call for participation: Issues suitable for new contributors
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants