I recently found that when running Vim in GNU Screen, I have to press Escape twice to get out of insert mode.
Beyond just googling or asking in forums, I would like to see the code behind Vim executing so I can try to see what is going on myself.
How could I get a print out of what happened in Vim when I pressed the Escape key the first time? Maybe it would show that it received the key press and what command it ended up corresponding to.
ctrl-vbeforeesc? – B Layer Sep 12 '21 at 11:25ctrl-vthenescand see^[...okay that's, normal. But then you only have to hitescone more time to leave Insert mode? Because if your bug was present in this scenario you'd have to press it twice (for a total of threeescs). Weird. – B Layer Sep 12 '21 at 16:25esc? – B Layer Sep 12 '21 at 16:32stracefor example:touch /tmp/sv; tail -f /tmp/sv;followed by something likestrace -ttt -e 'trace=open,read,write' -o /tmp/vs vim- you'll get the core sequences written to terminal. – Moba Jul 02 '22 at 14:08mousevariable:set mouse=(of course, i don't use a mouse in vim). – aleksandr barakin Jun 21 '23 at 12:21