Damn I was wanting to post this in bug reports since the behavior is off in my opinion.

Thanks for the alias but it doesn't account for all the ways a query window can be opened. Making the on open work no matter how the window was opened is the best solution.

My personal site with some scripts I've released.