Skip to content

feat(cli): suspend process on ctrl-z on non-windows platforms#11418

Closed
moaoa wants to merge 2 commits intovitejs:mainfrom
moaoa:vite-suspend
Closed

feat(cli): suspend process on ctrl-z on non-windows platforms#11418
moaoa wants to merge 2 commits intovitejs:mainfrom
moaoa:vite-suspend

Conversation

@moaoa
Copy link
Copy Markdown

@moaoa moaoa commented Dec 18, 2022

Description

this PR to suspend the process when we hit ctrl-z on non-windows platforms closes #11300

Additional context


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the PR Title Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@moaoa moaoa changed the title suspend proccess on ctrl-z on non-windows platforms feat: suspend proccess on ctrl-z on non-windows platforms Dec 18, 2022
Co-authored-by: Ben McCann <[email protected]>
@bluwy bluwy changed the title feat: suspend proccess on ctrl-z on non-windows platforms feat(cli): suspend process on ctrl-z on non-windows platforms Dec 28, 2022
@bluwy bluwy added the p3-minor-bug An edge case that only affects very specific usage (priority) label Dec 28, 2022
Copy link
Copy Markdown
Member

@bluwy bluwy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally and it seems to work for me 👍

@posva
Copy link
Copy Markdown
Contributor

posva commented Dec 28, 2022

Did you make sure it works when suspending the process with &?

vite dev &

Also worth noting the problem is not specific to Windows, in happens in OSX (and probably any unix system) too

@bluwy
Copy link
Copy Markdown
Member

bluwy commented Dec 28, 2022

@posva I swore I made a comment about that in #11300 but looks like GitHub didn't sent it through 😢 I tested your case and it was working for me. It suspended correctly for me even without this PR (macos).

@posva
Copy link
Copy Markdown
Contributor

posva commented Dec 28, 2022

You have to also type fg to bring the background process to the foreground, that's when you will be able to see the error

@moaoa
Copy link
Copy Markdown
Author

moaoa commented Dec 31, 2022

@posva

The proccess is suspended correctly with & but when I hit fg like you said the i get the following error:
error when starting dev server:
Error: setRawMode EINTR
at ReadStream.setRawMode (tty.js:77:31)
at bindShortcuts

I will look into that can help me?

Do we need a way to resume the process after we type ctrl-z?

@genki
Copy link
Copy Markdown

genki commented Jun 14, 2023

The issue is still alive. What stops this PR?

@posva
Copy link
Copy Markdown
Contributor

posva commented Jun 14, 2023

As the discussion says: the PR doesn't fix the issue

@genki
Copy link
Copy Markdown

genki commented Jun 19, 2023

@posva That's a pity.

@bluwy bluwy mentioned this pull request Sep 15, 2023
4 tasks
@bluwy bluwy closed this in #14342 Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

p3-minor-bug An edge case that only affects very specific usage (priority)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

suspend is not working in dev mode

5 participants