Focus editor on detach, focus scratchpad on attach