Use subprocess with CREATE_NO_WINDOW flag in WindowsViewer

This commit is contained in:
Andrew Murray 2024-02-10 19:47:50 +11:00
parent 6782a07b8e
commit 373c62e5cb

View File

@ -138,6 +138,17 @@ class WindowsViewer(Viewer):
f'&& del /f "{file}"'
)
def show_file(self, path: str, **options: Any) -> int:
"""
Display given file.
"""
subprocess.Popen(
self.get_command(path, **options),
shell=True,
creationflags=getattr(subprocess, "CREATE_NO_WINDOW"),
) # nosec
return 1
if sys.platform == "win32":
register(WindowsViewer)