diff --git a/src/calibre/gui2/__init__.py b/src/calibre/gui2/__init__.py index e41968581e..f3eec4eefa 100644 --- a/src/calibre/gui2/__init__.py +++ b/src/calibre/gui2/__init__.py @@ -854,8 +854,8 @@ def setup_gui_option_parser(parser): help='Detach from the controlling terminal, if any (linux only)') def detach_gui(): - if islinux and not DEBUG and sys.stdout.isatty(): - # We are a GUI process running in a terminal so detach from the controlling terminal + if islinux and not DEBUG: + # Detach from the controlling process. if os.fork() != 0: raise SystemExit(0) os.setsid() diff --git a/src/calibre/linux.py b/src/calibre/linux.py index c746606bee..0063714263 100644 --- a/src/calibre/linux.py +++ b/src/calibre/linux.py @@ -929,7 +929,7 @@ Name=E-book Viewer GenericName=Viewer for E-books Comment=Viewer for E-books in all the major formats TryExec=ebook-viewer -Exec=ebook-viewer %f +Exec=ebook-viewer --detach %f Icon=calibre-viewer Categories=Graphics;Viewer; ''' @@ -942,7 +942,7 @@ Name=Edit E-book GenericName=Edit E-books Comment=Edit e-books in various formats TryExec=ebook-edit -Exec=ebook-edit %f +Exec=ebook-edit --detach %f Icon=calibre-ebook-edit Categories=Office; ''' @@ -955,7 +955,7 @@ Name=calibre GenericName=E-book library management Comment=E-book library management: Convert, view, share, catalogue all your e-books TryExec=calibre -Exec=calibre %F +Exec=calibre --detach %F Icon=calibre-gui Categories=Office; '''