ember-cli: Sending intr (ctrl + c / interrupt) to ember serve doesn't fully terminate the app
Sending <kbd>ctrl</kbd> + <kbd>c</kbd> to a running ember serve should terminate the server and running ember-cli instance, but for some reason it does not completely clean up after itself and leaves my command prompt in an unfinished state, making it necessary for me to press <kbd>return</kbd> to actually get back to my regular prompt.
source/project on 🌱 master [$] via ⬢ v12.13.1 took 3s
❯ yarn start
(Ember project runs as expected)
<kbd>ctrl</kbd> + <kbd>c</kbd>
cleaning up...
⠋ cleaning up⏎
source/project on 🌱 master [$] via ⬢ v12.13.1 took 3s
_
("❯ " character missing, no more autocompletion from my shell, etc)
I’m using fish, but the same thing happens on zsh and bash, both with my current prompt enabled and disabled.
It’s really annoying and I wonder if it breaks more stuff beyond just me having to remember to do the extra key press which resets my prompt like that:
<kbd>↩</kbd>
source/project on 🌱 master [$] via ⬢ v12.13.1 took 49s
source/project on 🌱 master [$] via ⬢ v12.13.1 took 49s
❯
source/project on 🌱 master [$] via ⬢ v12.13.1 took 49s
❯
Output from ember version --verbose && npm --version && yarn --version:
ember-cli: 3.14.0
node: 12.4.0
v8: 7.4.288.27-node.18
uv: 1.29.1
zlib: 1.2.11
brotli: 1.0.7
ares: 1.15.0
modules: 72
nghttp2: 1.38.0
napi: 4
llhttp: 1.1.3
http_parser: 2.8.0
openssl: 1.1.1b
cldr: 35.1
icu: 64.2
tz: 2019a
unicode: 12.1
os: darwin x64
6.12.1
1.21.1
About this issue
- Original URL
- State: open
- Created 5 years ago
- Reactions: 2
- Comments: 22 (21 by maintainers)
Commits related to this issue
- Ensure progress is stopped when cli is terminated I'm pretty sure this is the wrong way of solving this, but it *does* solve https://github.com/ember-cli/ember-cli/issues/8969 to some extend. — committed to pichfl/console-ui by pichfl 4 years ago
- Update init.js This is a simple fix to solve the issue outlined here: https://github.com/ember-cli/ember-cli/issues/8969 @rwjblue recommended this. — committed to chrism/ember-cli by chrism 4 years ago
- Update init.js This is a simple fix to solve the issue outlined here: https://github.com/ember-cli/ember-cli/issues/8969 @rwjblue recommended this. — committed to chrism/ember-cli by chrism 4 years ago
Ya. 😭
I think at this point we should remove the suggestion to use
yarn start. 🤔If you run serve and wait until the build has completed, this can be triggered when using yarn.
ember s, build completes,control-creturns control to shellnpm start, build completes,control-creturns control to shellyarn start, build completes, control-c` returns control to shellInteresting, when trying to see if this is just a
yarn startthing, it doesn’t appear to be, as the following appears to work fine.It may be worth trying a minimal script, that starts of console-ui and kicks of progress on ctrl-c, and ends exists 1s later. Such an isolated example would be useful.
Debugging the same issue again today, this is almost certainly a yarn issue. I don’t believe we can do anything from our side here, at-least to address the general case of the parent process not waiting for the child to exit correctly.
Happens using globally installed (using Volta) ember-cli, also.
ember serveresults in the same problems.I tried in the snippets above, it happens anytime I run an Ember project and stop it via <kbd>ctrl</kbd>+<kbd>c</kbd>.
It doesn’t matter if I enable starship or not. I tested bash, zsh, fish. Each with and without starship and each on both Terminal.app and iTerm.
If it helps, these are the devDependencies in one of the projects: