fix: pgrep matches Emacs-arm64-11 variant (Emacs.app path)
This commit is contained in:
@@ -88,7 +88,10 @@ def get_emacs_pid():
|
|||||||
except OSError:
|
except OSError:
|
||||||
_emacs_pid = None
|
_emacs_pid = None
|
||||||
try:
|
try:
|
||||||
out = subprocess.check_output(["pgrep", "-x", "Emacs"], text=True).strip()
|
# Match any Emacs variant: Emacs, Emacs-arm64-11, Emacs-x86_64-10_14, etc.
|
||||||
|
out = subprocess.check_output(
|
||||||
|
["pgrep", "-f", "Emacs.app/Contents/MacOS/Emacs"], text=True
|
||||||
|
).strip()
|
||||||
pids = out.split("\n")
|
pids = out.split("\n")
|
||||||
_emacs_pid = int(pids[0])
|
_emacs_pid = int(pids[0])
|
||||||
return _emacs_pid
|
return _emacs_pid
|
||||||
|
|||||||
Reference in New Issue
Block a user