I have to deal with a legacy application exposing a CHUI (Character UI, i.e. VT100) on Solaris. Users access this via terminal emulation from Windows desktops. They use macros (sequences of characters to automate/smooth out) some repetitive operations (we are porting the app to expose services to a different front end, but it's a slow process).
What I am looking for is something that gives better control in terms of scripting: the current macros are just sequences of keypresses that are thrown at the terminal emulator, but there is no way to trap errors or parse the answers to the commands so the macro just goes on blindly even when the interface is expecting different input.
So basically I am looking for a terminal emulator which includes a scripting language on a par with Expect - something that can "detect" what the terminal is answering, parse it, match patterns and decide what to do (branching logic) based on that. Expect itself may be the solution, but I'd like to see if we can keep the scripting part on the Desktop first.