 -> short Emode
  jmp long_escape_mode    ; yes -> long Emode
  
; short esc mode
; escape_mode = $0f
; process first char
@short_escape_mode:
  tya         ; restore char
; --- [ ---
  cmp #brace  ; [ ?
  bne @not_brace
  lda #$ff    ; set esc [ mode
  sta escape_mode
  rts
; --- ( ---
@not_brace:
        cmp #$28    ; ( ?
        bne :+
        jmp set_discard_mode
; --- ) ---
: 
  cmp #$29    ; ) ?
  bne :+
  jmp set_discard_mode
; --- # ---
:
  cmp #$23    ; # ?
  bne :+
  jm