Read the terminal text

I want to read the terminal text after firing some command in it. I couldnt able to find any method or API

[original thread by dhananjayharel]

[dhananjayharel]

Alternative way is use of @theia/process extension but I couldn’t able to find the documentation / example , how to use it.