I want to listen to terminal output from extension, such as tsc -w
and catch the moment if the output contains similar text:
Found 1 error. Watching for file changes.
Or the error exit code or something like that. Is it possible to do with old API or Proposed API?
Tried:
terminal.onDidWriteData(data => {
console.log('onDidWriteData: ', data.trim());
});
It just outputs autogenerated rubbish like:
Windows PowerShell Copyright (C) Microsoft Corporation. All rights reserved.
Looks like it is deprecated in insiders edition. Try using window.onDidWriteTerminalData
:
window.onDidWriteTerminalData(event => console.log(event.data.trim()))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With