Instead merge continuous regions of colored output. This way different shell implementations shouldn't make a difference.
err(), errx(), warn(), warnx(), verr(), verrx(), vwarn(), vwarnx() are hooked.