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

2.0.12 ctrl+c doesnot close the server #1895

Closed
anandarpit opened this issue Jul 21, 2021 · 1 comment
Closed

2.0.12 ctrl+c doesnot close the server #1895

anandarpit opened this issue Jul 21, 2021 · 1 comment

Comments

@anandarpit
Copy link

  • nodemon -v: 2.0.12
  • Operating system/terminal environment (powershell, gitshell, etc): windows 10/git-bash
  • Using Docker? What image: Not using docker
  • Command you ran: ctrl + c

Expected behavior

close down the server

Actual behavior

hangs the terminal and does not take any further input

Steps to reproduce

I updated the nodemon to the specified latest version and ran the cmd nodemon server.js


dump file:

   dump: true,
   ignore: [
     '**/.git/**',
     '**/.nyc_output/**',
     '**/.sass-cache/**',
     '**/bower_components/**',
     '**/coverage/**',
     '**/node_modules/**',
     re: /.*.*\/\.git\/.*.*|.*.*\/\.nyc_output\/.*.*|.*.*\/\.sass\-cache\/.*.*|.*.*\/bower_components\/.*.*|.*.*\/coverage\/.*.*|.*.*\/node_modules\/.*.*/
   ],
   watch: [ '*.*', re: /.*\..*/ ],
   monitor: [
     '*.*',
     '!**/.git/**',
     '!**/.nyc_output/**',
     '!**/.sass-cache/**',
     '!**/bower_components/**',
     '!**/coverage/**',
     '!**/node_modules/**'
   ],
   ignoreRoot: [
     '**/.git/**',
     '**/.nyc_output/**',
     '**/.sass-cache/**',
     '**/bower_components/**',
     '**/coverage/**',
     '**/node_modules/**'
   ],
   restartable: 'rs',
   colours: true,
   execMap: { py: 'python', rb: 'ruby', ts: 'ts-node' },
   stdin: true,
   runOnChangeOnly: false,
   verbose: false,
   signal: 'SIGUSR2',
   stdout: true,
   watchOptions: {},
   execOptions: {
     script: 'server.js',
     exec: 'node',
     args: [],
     scriptPosition: 0,
     nodeArgs: undefined,
     execArgs: [],
     ext: 'js,mjs,json',
     env: {}
   }
 },
 load: [Function (anonymous)],
 reset: [Function: reset],
 lastStarted: 0,
 loaded: [],
 watchInterval: null,
 signal: 'SIGUSR2',
 command: {
   raw: { executable: 'node', args: [ 'server.js' ] },
   string: 'node server.js'
 }
}

I have also used this code to gracefully shut down the server:

process.on('SIGINT', function() {
    console.log( "\nGracefully shutting down from SIGINT (Ctrl-C)" );
    process.exit(1);
  }); 
@remy
Copy link
Owner

remy commented Sep 22, 2021

Screenshot 2021-09-22 at 14 15 17

This is working consistently for me, but am able to replicate when I run git bash from vscode. If you're doing the same - then this is a VS Code bug combined with git bash. Happy for you point the vscode devs to this to replicate, but it's definitely outside of nodemon.

@remy remy closed this as completed Sep 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants