Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 17 additions & 9 deletions client/ayon_core/lib/execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,23 +254,31 @@ def run_detached_process(args, **kwargs):
args = new_args

elif low_platform == "windows":
flags = (
subprocess.CREATE_NEW_PROCESS_GROUP
| subprocess.DETACHED_PROCESS
)
kwargs["creationflags"] = flags
flags = kwargs.get("creationflags")
if flags is None:
# Create new console if executable is ayon_console,
# otherwise create detached process.
executable_filename = os.path.basename(args[0]).lower()
if executable_filename == "ayon_console.exe":
flags = subprocess.CREATE_NEW_CONSOLE
else:
flags = subprocess.DETACHED_PROCESS
if not sys.stdout:
kwargs["stdout"] = subprocess.DEVNULL
kwargs["stderr"] = subprocess.DEVNULL

# New process will become new process group
flags |= subprocess.CREATE_NEW_PROCESS_GROUP

if not sys.stdout:
kwargs["stdout"] = subprocess.DEVNULL
kwargs["stderr"] = subprocess.DEVNULL
kwargs["creationflags"] = flags

elif low_platform == "linux" and get_linux_launcher_args() is not None:
json_data = {
"args": args,
"env": kwargs.pop("env")
}
json_temp = tempfile.NamedTemporaryFile(
mode="w", prefix="op_app_args", suffix=".json", delete=False
mode="w", prefix="ayon_app_args", suffix=".json", delete=False
)
json_temp.close()
json_temp_filpath = json_temp.name
Expand Down
Loading