<p>The socket file is in /tmp to maximise the chances its on a file system that supports sockets, home directories may be on Samba windows mounts that don't.</p>
<p>To not conflict with other things in /tmp it is a random name created by <code>tmpfile()</code>, so Geany locates it by a link which has a known name in the configuration directory you specify with <code>-c</code> (or your <code>~/.config/geany</code> if no <code>-c</code>).</p>
<p>If the configuration does not contain a link with the right name Geany will consider itself a new "master" as you called it, and make another socket.  The <code>--socket_file</code> option is to allow a command line command to nominate which instance it is to open files in.</p>
<p>In your use-case of one "proper" instance and one scratch instance you would be best to use differing configs for each, so each has a socket and so you can then nominate on the terminal which one to use.  If most of the command line opens are in the scratch version, have it use your home config, which is the default, and so you don't have to specify it in the majority of cases on the command line.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany/issues/1834#issuecomment-382976268">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABDrJ_a7lhkJ47QPwREVg7VpWciYL-IQks5tqWqQgaJpZM4Tc28K">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABDrJ8Q8kTSpL9eYUb1ZpgqBIqGTUUoIks5tqWqQgaJpZM4Tc28K.gif" height="1" width="1" alt="" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/geany/geany/issues/1834#issuecomment-382976268"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/geany/geany","title":"geany/geany","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/geany/geany"}},"updates":{"snippets":[{"icon":"PERSON","message":"@elextr in #1834: The socket file is in /tmp to maximise the chances its on a file system that supports sockets, home directories may be on Samba windows mounts that don't.\r\n\r\nTo not conflict with other things in /tmp it is a random name created by `tmpfile()`, so Geany locates it by a link which has a known name in the configuration directory you specify with `-c` (or your `~/.config/geany` if no `-c`).  \r\n\r\nIf the configuration does not contain a link with the right name Geany will consider itself a new \"master\" as you called it, and make another socket.  The `--socket_file` option is to allow a command line command to nominate which instance it is to open files in.\r\n\r\nIn your use-case of one \"proper\" instance and one scratch instance you would be best to use differing configs for each, so each has a socket and so you can then nominate on the terminal which one to use.  If most of the command line opens are in the scratch version, have it use your home config, which is the default, and so you don't have to specify it in the majority of cases on the command line."}],"action":{"name":"View Issue","url":"https://github.com/geany/geany/issues/1834#issuecomment-382976268"}}}</script>