We are running Windows Clients with Cygwin XServer that has a bash script application running on AIX Unix. We have a login script using expect to ssh into the server and then xterm to create the client terminal.

This is working fine except on any form screen, after the fields are updated and the ______ line is erased a single . is left at the end.

I tried different fonts and sizes but no matter what I do, that single . is left after the line is erased.

Any ideas?

  • 1
    I think this is the first bounty. If so, you deserve a medal. Wish I had an answer to your question, but I gave up on Cygwin a while ago. Aug 20, 2010 at 18:25

1 Answer 1


In expect you can clear the screen using the raw vt100 commands:

puts -nonewline \033\[2J 
flush stdout

That was the solution to my question on stackoverflow. Perhaps it can help you.

An example of setting an interact "hook" into the expect script on your spawned ssh session might look something like this:

spawn ssh -Y user@host
#password sequence...
set CTRLA \001
#don't time out
set timeout -1 
interact {
    $CTRLA {
        #clear screen
        puts \033\[2J

Then only if you hit that Ctrl+A keystroke do you send the clear command. You could also interact then take action on seeing a certain field or character on screen.

-o -nobuffer -re {(\[1;14H} {
    #clear screen
    puts \033\[2J
  • Its a third party collection of scripts, so once expect hands off control to them, I can't do anything. I can control how cygwin XServer is set up, and how XTerm is launched from the unix box. I also have limited configuration control over the server.
    – Kenoyer130
    Aug 20, 2010 at 18:43
  • Maybe you could put an interact hook into the expect script to run the raw command on a certain keystroke or after some expected event, similar to my script on this question: stackoverflow.com/questions/1988811/…
    – jjclarkson
    Aug 20, 2010 at 18:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .