Expose open and close commands.
New window command;  fix #562