Refactor termStarted into more generic impl

Editor also now accepts from parent VC the key codes to “trap”