Generalize mode segment so prompt mode char is defined with before/after