title: Refreshing bash prompt after calling bind -x command
body: <p>I have a bash function that changes the directory of my current bash session. I'd like to call the function by pressing Alt-M and am using <code>bind -x</code> to create this mapping. After entering Alt-M on my keyboard, nothing happens in my bash prompt - there is no new line as there would be if a function were typed and then Enter was pressed. I have to press Enter again to get a new prompt on a new line.</p>
  <p>How can I force there to be a new prompt on a new line? If I call the function directly/normally (i.e. by typing <code>foo</code> and then hitting enter), the command will work as expected and there will be a bash prompt on a new line, with a refreshed PS1.</p>
  <p>Using <code>echo</code> or <code>printf</code> commands in the function doesn't work - it prints a new line, but above the bash prompt, and the bash prompt doesn't refresh. What exactly is not happening here that I want to happen?</p>
  <pre><code>foo(){
      dir=&quot;/some/path&quot;
      cd $dir
  }
  
  bind -x '&quot;\em&quot;: foo'
  </code></pre>