Aiden Leong
Aiden Leong

Reputation: 121

How to change process title in Swift on Linux?

Python: setproctitle How to do the same thing in Swift?

Upvotes: 1

Views: 192

Answers (1)

Caleb Kleveter
Caleb Kleveter

Reputation: 11494

You can mutate that ProcessInfo.processName property:

ProcessInfo.processInfo.processName = "New Name"

The documentation for this property does give this warning

User defaults and other aspects of the environment might depend on the process name, so be very careful if you change it. Setting the process name in this manner is not thread safe.

Upvotes: 2

Related Questions