title: How to reset terminal without losing the current command?
body: <p>I'm trying to create a keyboard shortcut to reset the current terminal.
  I'm using a .inputrc entry like this:</p>
  
  <pre><code>"\C-K": 'echo -en "\\033c"\n'
  </code></pre>
  
  <p>It works, however, I can't do that while typing a command.</p>
  
  <p>For instance, if I'm typing a command like this (with the cursor at the end):</p>
  
  <pre><code>$ foobar
  </code></pre>
  
  <p>and press CTRL+K, it will become</p>
  
  <pre><code>$ foobarecho -en "\033c""
  </code></pre>
  
  <p>and, of course, it is not going to work.
  It is possible to do it?</p>
  
  <p>I suppose it is possible, since that's what CTRL+L does.
  The only problem with CTRL+L is that it won't clear the entire terminal, including history, just what's on screen.</p>