48

How do you stop files from being watched?

I have not seen the method in the docs which seems a bit odd to me.

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
Richard
  • 4,516
  • 11
  • 60
  • 87

3 Answers3

127

It's not a gulp thing. Gulp is just running as a never ending process.

The way to abort a process is Ctrl+C.

Sindre Sorhus
  • 62,972
  • 39
  • 168
  • 232
  • Doesn't that stop ALL running processes? How can you see which processes are running? – Kokodoko Jan 24 '16 at 13:57
  • 7
    @Kokodoko No. It only stops the foreground process in the terminal that you're in. Cntrl-C is sent by your terminal (cmd, bash, sh, etc.) as a signal (specifically; SIGINT) to the foreground process - typically whatever is using stdin (the keyboard). Cntrl-C doesn't actually guarantee that the process will end; the process can intercept that signal and do something with it (see, for example, the behaviour of the node shell). But if the signal is unhandled, the process will be killed. See: http://unix.stackexchange.com/a/149756/111256 – Micheal Hill Feb 25 '16 at 04:42
  • 1
    Sometimes it happens that gulp process crashes and can't be stopped by Ctrl+C. In that case just close all terminal windows and start in a new one. And it should be working there. – dekisha Jun 15 '17 at 10:52
4

According the official document. you can using returned stream method to stop it.

let watchStream = gulp-watch(paths, function(){}) watchStream.close()

stackFish
  • 597
  • 4
  • 12
0

If you are using Visual Studio 'Package Manager Console' just press red square button inside that window.