Autoupdate python component

Hello,
I have the simple Python code:

a = rs.CommandHistory()
print (a)

How is it possible to automatically update it when I add new command on Rhino prompt?

Thank you

This is an old post, so things might have changed since, but it doesn’t look like there is event for that: