I'm finalizing a Perl script that, during its operation, brings up
$EDITOR, which in some cases (e.g. EDITOR=/usr/bin/xemacs) can
cause a second X window for the editor to pop up. Annoyingly, when
this second window closes the original terminal window that spawned
it does not get the focus back. This forces the user to use the
mouse, in what would otherwise be an entirely mouseless interaction.
Is there any trick to return the focus to the original window after
the temporary editor window has been closed?