If I remove the esc and enter key commands and leave just "echo This is a test", then TCMD does not crash, but I get an error message "The handle is invalid. "WriteFile".
The toolbar buttons that do not send text to the current tab do work as expected.