fixed for cygwin and xterm terminals