Attempt to recognize unix and cygwin consoles before falling back to
swing