<p>Windows support is annoying :(.</p>
<p><a href="https://github.com/lex" class="user-mention">@lex</a> On Windows, we always strip the <code>file://</code> prefix in <a href="https://github.com/geany/geany/blob/master/src/win32.c#L789">https://github.com/geany/geany/blob/master/src/win32.c#L789</a>.<br>
This has been added to support the "builtin" Run command for HTML files, this wouldn't work otherwise. Maybe this just masks another bug in constructing the URI in the "builtin" Run command logic which is pretty much wrong for Windows.<br>
However, I don't want to open three new issues two weeks before the release.</p>
<p><a href="https://github.com/codebrainz" class="user-mention">@codebrainz</a> Even with a proper URI, it won't open from within Geany as we call <code>ShellExecute</code> and this function does not support anchors in the URL (anymore, reports on the net indicate that it worked in Windows XP).<br>
The reason we use <code>ShellExecute("open", uri, ...)</code> on Windows is that it's the easiest way to open the system's default browser without any hassle. Well, except the hassle with anchors.</p>
<p>I see two ways to proceed here:</p>
<ul>
<li>quick'n'easy solution: in <code>win32_open_browser</code> simply strip off any anchors in the URL</li>
<li>instead of unconditionally use <code>ShellExecute</code> on Windows, use the browser command configured in the preferences and maybe fallback to <code>ShellExecute</code> in case no browser is configured</li>
</ul>
<p>I'd prefer the second solution as it seems more reasonable to me, fixes the anchor problem cleanly (already tested) and also would allow the user to choose another browser than the system's default one. Currently, the browser command setting in the preferences is completely ignored on Windows.</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/1522#issuecomment-310887801">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABDrJ6YCwRVwR-4WsRwSxTvzpZeyxtzfks5sHgzrgaJpZM4ODKDO">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ABDrJx1LsiO8WJgrkyNl8Yh7rNyBNfNjks5sHgzrgaJpZM4ODKDO.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/1522#issuecomment-310887801"></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":"@eht16 in #1522: Windows support is annoying :(.\r\n\r\n@Lex On Windows, we always strip the `file://` prefix in https://github.com/geany/geany/blob/master/src/win32.c#L789.\r\nThis has been added to support the \"builtin\" Run command for HTML files, this wouldn't work otherwise. Maybe this just masks another bug in constructing the URI in the \"builtin\" Run command logic which is pretty much wrong for Windows.\r\nHowever, I don't want to open three new issues two weeks before the release.\r\n\r\n@codebrainz Even with a proper URI, it won't open from within Geany as we call `ShellExecute` and this function does not support anchors in the URL (anymore, reports on the net indicate that it worked in Windows XP).\r\nThe reason we use `ShellExecute(\"open\", uri, ...)` on Windows is that it's the easiest way to open the system's default browser without any hassle. Well, except the hassle with anchors.\r\n\r\nI see two ways to proceed here:\r\n- quick'n'easy solution: in `win32_open_browser` simply strip off any anchors in the URL\r\n- instead of unconditionally use `ShellExecute` on Windows, use the browser command configured in the preferences and maybe fallback to `ShellExecute` in case no browser is configured\r\n\r\nI'd prefer the second solution as it seems more reasonable to me, fixes the anchor problem cleanly (already tested) and also would allow the user to choose another browser than the system's default one. Currently, the browser command setting in the preferences is completely ignored on Windows."}],"action":{"name":"View Issue","url":"https://github.com/geany/geany/issues/1522#issuecomment-310887801"}}}</script>