Closed Tyriar closed 1 month ago
@whitequark no, this is only for when shell integration is enabled. There is the related proposal for buffer access which allows reading the buffer which would probably cover your use case. https://github.com/microsoft/vscode/issues/207504
@Tyriar Thank you, this really helps!
I have a quick question. What is the difference between this API and vscode.proposed.terminalExecuteCommandEvent.d.ts? My current use case is grabbing the output from an executed command, and I am using vscode.proposed.terminalExecuteCommandEvent.d.ts to do so. I suppose we can also use read() from vscode.proposed.terminalShellIntegration.d.ts to read the output stream but feel free to correct me. I wonder which one would you think have a higher chance for public release. Before these two APIs I remembered having to work around with the old vscode.proposed.terminalDataWriteEvent.d.ts, so I truly appreciate the current more stable approaches you have made available. Thanks!
@itstreefam terminalExecuteCommandEvent
is old and will be removed, terminalDataWriteEvent
is unlikely to get finalized and may be replaced eventually with improvements upon terminalShellIntegration
. terminalShellIntegration
should be finalized very soon, I just need a fix a few bugs with it.
Plan:
Shell integration in the terminal could enable APIs like being able to listen to commands that run and get their output/exit code.
Rough example: