title: Binding Escape key (ESC) in Emacs running in Console (-nw)
body: <p>I am trying to bind the <code>ESC</code> key to a custom elisp function,</p>
  
  <pre><code>(global-set-key (kbd "&lt;escape&gt;") 'my-local-mode)
  </code></pre>
  
  <p>which works under X but does not when emacs is running in a termial. ESC acts as META. However I have tried evil mode and it is able to capture ESC (single ESC not M-ESC ESC). However digging thorugh the code I can not figure out where/how they did it. <code>describe-key</code> doesn't work. How can I bind single ESC press to call my function?</p>