Skip to content

Commit fdb5ad9

Browse files
committed
meld/melddoc.py: Fix windows external open (#354)
When in a Meld folder comparison in Windows, a file or subfolder can be opened externally with default windows application (e.g. explorer for folders, previously selected application for files, or the windows file open option popup for unspecified types). Right-mouse button click and "Open externally" should produce this behaviour, however currently folders with spaces in the path produce unexpected behaviour such as command line windows opening. Changing the relevant system call from subprocess.Popen() to the windows-specific os.startfile() fixes this behaviour and handles paths with spaces in them in the expected way. https://gitlab.gnome.org/GNOME/meld/-/issues/354
1 parent 1c51517 commit fdb5ad9

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

meld/melddoc.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
import enum
1818
import logging
19+
import os
1920
import pipes
2021
import shlex
2122
import string
@@ -127,7 +128,7 @@ def os_open(path: str, uri: str):
127128
if not path:
128129
return
129130
if sys.platform == "win32":
130-
subprocess.Popen(["start", path], shell=True)
131+
os.startfile(path)
131132
elif sys.platform == "darwin":
132133
subprocess.Popen(["open", path])
133134
else:

0 commit comments

Comments
 (0)