# emacs has the openwith package
$ emacs -nw
# navigate to a directory in dired mode
# move up and down arrows to pick a file, e.g. a .pdf file
# press v
# file is opened by a gui pdf viewer e.g. okular
# exit the pdf viewer
# emacs window is no longer focused
# would like emacs window to be focused please.
# emacs does not crash.
# mate desktop environment
# occurs with marco window manager
# does NOT occur with compiz window manager
In GNU Emacs 27.1 (build 1, x86_64-redhat-linux-gnu, GTK+ Version
3.24.22, cairo version 1.16.0)
of 2020-08-20 built on buildhw-x86-03.iad2.fedoraproject.org
System Description: Fedora 33 (MATE-Compiz)
Waiting for git... [2 times]
[yas] Prepared just-in-time loading of snippets successfully.
For information about GNU Emacs and the GNU system, type C-h C-a.
(Nothing to omit)
Omitted 90 lines.
value of $LANG: en_US.UTF-8
value of $XMODIFIERS: @im=none
Major mode: Dired by name
Minor modes in effect: