fix problem where terminal is incorrectly detected
allow for overlapping formats
add match format for grep coloring