Strip ANSI codes from parser errors in IDE

Fixes #1458.