Skip to main content

Module single_instance

Module single_instance 

Source
Expand description

Single-Instance Mutex and Inter-Process Communication (IPC) Window Focusing.

Prevents duplicate application processes from opening when an executable is launched repeatedly, automatically forwarding CLI arguments to the primary instance and requesting window focusing / un-minimization.

Unix hosts use a domain socket in $XDG_RUNTIME_DIR (falling back to /tmp). Windows hosts use a named pipe at \\.\pipe\<sanitized-app-id>. Both transports forward newline-separated CLI arguments to the primary instance.

Structs§

SingleInstanceLock
Mutex handle holding the single-instance lock and IPC listener thread.

Enums§

SingleInstanceStatus
Status result when attempting to acquire a single-instance application lock.

Functions§

decode_args
Decodes arguments from the length-prefixed binary wire format.
encode_args
Serializes a slice of arguments into length-prefixed binary wire format.