Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
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. – Stefan Lasiewski Aug 20 '10 at 18:25
up vote 2 down vote accepted

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
share|improve this answer
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 '10 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 '10 at 18:54

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.