Relative Content

Tag Archive for javascriptnode.jsstdinvitest

Removing [stdin] keypress listener (or going around) from 3rd party app within plugin/extension (Vitest in this case)

I am writing Vitest reporter, when running tests in watch mode there is an active listener on keypress event on stdin. I want to have my own handling of user interaction, and this one pretty aggressively goes even into shortcuts that are part of few of its registered keys.
My attempts at removing it were unsuccessful so far, i tried to use removeAllListeners on stdin, which didn’t work and was unable to use removeListener which requires second argument which is a function I don’t have access to.