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

Most upvoted comments

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.

  1. works fine: ember s, build completes, control-c returns control to shell
  2. works fine: npm start, build completes, control-c returns control to shell
  3. funky behavior: yarn start, build completes, control-c` returns control to shell

Interesting, when trying to see if this is just a yarn start thing, it doesn’t appear to be, as the following appears to work fine.

"scripts": {
  "start": "node -e 'while(true) { }'",
}

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 serve results 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:

    "@ember/optional-features": "^1.1.0",
    "@ember/render-modifiers": "1.0.2",
    "@fullhuman/postcss-purgecss": "^1.3.0",
    "@glimmer/component": "1.0.0",
    "@jaames/iro": "^4.5.3",
    "@mapbox/mapbox-sdk": "^0.9.0",
    "@sentry/browser": "^5.10.2",
    "@sentry/integrations": "^5.10.2",
    "@turf/circle": "^6.0.1",
    "babel-eslint": "^10.0.3",
    "broccoli-asset-rev": "^3.0.0",
    "date-fns": "^2.8.1",
    "ember-auto-import": "^1.5.3",
    "ember-cli": "~3.14.0",
    "ember-cli-app-version": "^3.2.0",
    "ember-cli-babel": "^7.13.2",
    "ember-cli-dependency-checker": "^3.2.0",
    "ember-cli-deprecation-workflow": "^1.0.1",
    "ember-cli-document-title-northm": "^1.0.3",
    "ember-cli-eslint": "^5.0.0",
    "ember-cli-htmlbars": "^4.2.0",
    "ember-cli-inject-live-reload": "^2.0.2",
    "ember-cli-postcss": "^5.0.0",
    "ember-cli-sri": "^2.1.1",
    "ember-cli-template-lint": "^1.0.0-beta.1",
    "ember-cli-uglify": "~3.0.0",
    "ember-concurrency": "machty/ember-concurrency#mf-avoid_double_compute_assertion",
    "ember-data": "3.14.0",
    "ember-data-storefront": "^0.17.1",
    "ember-export-application-global": "^2.0.1",
    "ember-fetch": "^7.0.0",
    "ember-focus-trapper": "^0.3.0",
    "ember-hbs-minifier": "^0.4.1",
    "ember-intl": "^4.2.2",
    "ember-load-initializers": "^2.1.1",
    "ember-maybe-import-regenerator": "^0.1.6",
    "ember-qunit": "^4.6.0",
    "ember-radio-button": "^2.0.1",
    "ember-resolver": "^6.0.0",
    "ember-router-scroll": "~1.3.3",
    "ember-set-helper": "^0.1.1",
    "ember-simple-auth": "~2.1.0",
    "ember-simple-auth-token": "^4.0.7",
    "ember-source": "3.15.0",
    "ember-truth-helpers": "^2.1.0",
    "eslint": "^6.7.2",
    "eslint-plugin-ember": "^7.7.2",
    "eslint-plugin-node": "^10.0.0",
    "jwt-decode": "^2.2.0",
    "konva": "^4.0.18",
    "loader.js": "^4.7.0",
    "marked": "^0.8.0",
    "moment": "^2.24.0",
    "normalize.css": "^8.0.1",
    "nouislider": "^14.1.0",
    "pikaday": "^1.8.0",
    "postcss-import": "^12.0.1",
    "postcss-preset-env": "^6.7.0",
    "prettier": "^1.19.1",
    "qunit-dom": "^0.9.2",
    "tailwindcss": "^1.1.4",
    "webfontloader": "^1.6.28"