title: How to get the ipython notebook title associated with the currently running ipython kernel
body: <p>I usually have 5-10 different ipython notebooks running with associated consoles/kernels.  It is hard for me to keep track of which console/kernel belongs to which notebook.  For a while I put a comment with the notebook title at the top of each notebook and executed that comment in the kernel. That way I could type  the '#' and then up arrow from console and it would show the comment.  I think there is probably an easier way to keep track of my consoles.</p>
  
  <p>The below code snippets show what is going on.</p>
  
  <p>Suppose I am running an ipython notebook server, and I create a new notebook with a title called TestA.  </p>
  
  <p>Then suppose I run the following commands in the new notebook </p>
  
  <pre><code>%connect_info  #prints connection information
  %qtconsole  
  </code></pre>
  
  <p>This opens up an ipython terminal console window (kernel might be the proper name) associated with the same notebook.</p>
  
  <p>If I then type the following command in the ipython terminal console</p>
  
  <pre><code>%connect_info
  </code></pre>
  
  <p>I can determine which notebook is associated with which ipython consoles/kernels, but this requires a bit of work.  Is there a command, magic, or macro that I can get the title (if present) of the currently running notebook?  </p>
  
  <p>I saw <a href="https://stackoverflow.com/questions/12544056/how-to-i-get-the-current-ipython-notebook-name">How do I get the current IPython Notebook name</a> </p>
  
  <p>Though the comments indicate this might not work, this solution appears to work on my setup but I wasn't sure if there is a better way to do this.</p>
  
  <p>I decided to reask this question based on a Q&amp;A on the SO meta site: <a href="https://meta.stackexchange.com/questions/147027/purposely-re-asking-duplicating-an-old-question">https://meta.stackexchange.com/questions/147027/purposely-re-asking-duplicating-an-old-question</a> </p>