Skip to content

Commit

Permalink
[HOTFIX] Fix for MacOS
Browse files Browse the repository at this point in the history
See #50

Set multiprocessing.set_start_method("fork") before initializing
multiprocessing.Manager. Without this it will spawn an infinite number
of subprocesses on Apple M1.
  • Loading branch information
subnut committed Mar 14, 2023
1 parent b4b512c commit 4a36d12
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions binary.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import json
import multiprocessing
import os
import platform
import random
import signal
import socket
Expand All @@ -19,7 +20,7 @@
from simple_websocket_server import WebSocket
from simple_websocket_server import WebSocketServer

BUILD_VERSION: str = "v0.3.0"
BUILD_VERSION: str = "v0.3.1"

WINDOWS: bool = os.name == "nt"
LOCALHOST: str = "127.0.0.1" if WINDOWS else "localhost"
Expand All @@ -32,7 +33,8 @@
else:
sys.exit("Invalid value of $NVIM_GHOST_LOGGING_ENABLED")


if platform.system() == "Darwin":
multiprocessing.set_start_method("fork")
process_manager = multiprocessing.Manager()
global_ns = process_manager.Namespace()
global_ns.focused_nvim_addr = os.environ.get("NVIM_LISTEN_ADDRESS", None)
Expand Down
2 changes: 1 addition & 1 deletion binary_version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.3.0
v0.3.1

0 comments on commit 4a36d12

Please sign in to comment.