Comment by nhubbard
I would normally do something like that; however, we opted to open an AppleCare Enterprise case for it, since it gets an engineer to look into the issue.
Both our Mac IT manager and I are thinking that it's the AV engine (Microsoft Defender) seeing fragments of YAML in the PSI tree and then blowing up after trying to parse the next line (which is not a truly valid YAML tree, it's a YAML tree with all the semantic details produced by IntelliJ). That in and of itself shouldn't be an issue, but I guess they weren't expecting random fragments of YAML to be copied and pasted.
We're still not sure why it only triggers in terminal emulators, though. That one is a total mystery.