There seems to be a bug with the focus behaviour for the Terminal tool. I'll describe how to reproduce it:
Open a terminal window, then select somewhere in the code editor to give it focus instead.
Select another tool window (e.g. "Messages", or "TODO").
Select the "Terminal" tool again and notice that the command line will not be focused.
If I start typing then the text will type into the code editor instead.
If this is not a bug, is there some way to change this behaviour in the settings so that selecting the Terminal will always give it focus?