Skip to content

Conversation

sshekhar563
Copy link
Contributor

Problem:

The single-instance detection feature fails on systems where the environment variable used for the username (USER or USERNAME) contains characters that are invalid in filenames (e.g., /, ).

This prevents the .lock file from being created, which causes the application to allow multiple instances to run simultaneously, even when the option is disabled.

Solution:

This PR resolves the issue by sanitizing the username string before it is used to construct the lock file identifier. It uses a regular expression to find and replace all invalid filename characters with an underscore (_).

This approach is more robust as it protects against invalid characters from any source, ensuring the lock file can always be created.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant