xcall MIAMEX, MX_GETECHO, echon
The echon parameter is a numeric field into which a non-zero value is returned if terminal echo is currently enabled, and a zero value otherwise.
You can enable/disable echo using XCALL ECHO and XCALL NOECHO.