Open andykais opened 2 years ago
Let's try watcher_test.ts
from PR. It is still needed to press something to break for..of
cycle, because there are no ways to abort Deno.stdin.read()
;
May be close
method of watcher is a good workaround in some cases, but it can be completely messy if i pass my reader explicitly.
I think we need to think about it a little bit more.
I am developing an application with this library and occasionally the application crashes during development. This often leaves my terminal in a 'tty raw' state, where I cant use keys like "ctrl+c". For now the fix is to add a
Deno.setRaw(Deno.stdin.rid, false)
somewhere in my shutdown code. Ideally though, this library would add aclose()
hook, or the ability to pass in anAbortController
. For instance, this is howDeno.watchFs
handles cleanup: