Hi @axa,
Perhaps this?
https://developer.rhino3d.com/api/rhinocommon/rhino.rhinoapp/capturedcommandwindowstrings
ā Dale