iTerm2 crashes during lem session - solution
I think I discovered why the iTerm2 terminal crashes during sessions with lem. When you use the mouse for resizing the terminal frame or doing something similar, the mouse issues a sequence of chars that lem sees as an Escape key press. Since the Escape key is not defined lem crashes. The solution is defined the Escape key as, for instance, 'keyboard-quit, and I did so by adding the following line to the ~/.lem/init.el file:
(define-key global-keymap "Escape" 'keyboard-quit)
I like this solution. However, it assigns a role to the Escape key that is very different from Emacs. Therefore, I decided against creating a pull request. I leave to the developer of lem the task of assigning a function for the Escape key.