Initial revision
do all the work in create_window(), because if we have to start a new-session,
we want to give a name (-n) to its first window.
complete rewrite; master is now on f
from Jan 2011 : only check defined sessions