When cmd+k is on going, focus should be on it

Going back to cursor, clicking in the window should focus on the cmd+K pane if it’s open.
Now I go back to cursor, press cmd+enter to accept the changes but instead cursor starts creating code because the focus isn’t on the panel anymore.