<p>There are good reason for running geany via sudo, as opposed to gksudo.</p>

<p>I'm aware of bug <a href="https://github.com/geany/geany/issues/294" class="issue-link js-issue-link" data-url="https://github.com/geany/geany/issues/294" data-id="36252042" data-error-text="Failed to load issue title" data-permission-text="Issue title is private">#294</a>, and why this happens with sudo and not gksudo. (In short, because gksudo sets $HOME to /root, while sudo leaves $HOME to same as user - and if user is already running geany in their user session, an attempt to open the same config file will be made, and fail).</p>

<p>Please allow me to explain why this shouldn't be dismissed as "not a bug", just because there is a workaround. The problem is not <em>just</em> that sudo works differently than gksudo. The problem is that, <em>and</em> Geany's flawed implementation of config file (or "domain socket" or whatever is going on with that file).</p>

<p>Like many Linux administrators / power users, I use GUI tools with sudo very often, for three related reasons: 1) I prefer working in a terminal; 2) I prefer GUI terminals for ease-of-use [e.g. highlight/copy/paste, color, resize]; and 3) I prefer using sudo in a GUI terminal instead of gksudo, so that I don't have to input my password every single time I open a system configuration file for editing - which is often.</p>

<p>I use many GUI tools this way, and none of them have the problems Geany has. I love Geany - both for system configuration file editing as well as personal file editing, but have had to quit using it because this bug prevents productivity way too often.</p>

<p>It is a bug because a very simple and common use case is prohibited for no good reason, shouldn't be prohibted, and no other similar tools have the same prohibition.</p>

<p>A fix should be simple, in theory. Either:</p>

<ol>
<li><p>Don't use temporary config files [or whatever is being referenced by "domain socket error"], or</p></li>
<li><p>Detect if $USER == "root" but $HOME points to somewhere in /home. If so, use /root if it exists, or %TMP% as a fallback (in a unique and secure way that has been exhaustively documented elsewhere on the nets).</p></li>
</ol>

<p>Sure, the second one - without additional smarts - might not catch all distributions and/or custom installs, but would cover 99%+ of the user base. And for that tiny percentage that it might not cover, their situation wouldn't be any worse that it is now.</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/1150">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABDrJzRsyIzUoKPyiz-82MGWWoEaa7dvks5qZVqXgaJpZM4JUsAv">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ABDrJ7ZDXTIsyKcAe2s2Tr1tgwrrwHMAks5qZVqXgaJpZM4JUsAv.gif" width="1" /></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/1150"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>