If you want to excape for example a traceroute you
have to use the excape key. For cisco devices it’s normally crtl-shift-6-X. This is not so easy. It’s easier to change the excape key for example to ctrl-c.
Add the line:
line vty 0 4
escape-character 3
to your vty configuration.