<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Files open twice]]></title><description><![CDATA[<p dir="auto">Hi<br />
I’m trying to open files from other program but if the file i want to open is already open in np++ the file will be open twice</p>
<p dir="auto">Basically my command line is:</p>
<pre><code>C:\\Program Files\\Notepad++\\notepad++.exe "test.txt" "-n123"
</code></pre>
<p dir="auto">how to fix?</p>
<p dir="auto">thx!</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/24833/files-open-twice</link><generator>RSS for Node</generator><lastBuildDate>Thu, 11 Jun 2026 09:57:00 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/24833.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 19 Aug 2023 07:39:57 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Files open twice on Mon, 21 Aug 2023 07:05:06 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/coises" aria-label="Profile: Coises">@<bdi>Coises</bdi></a> said in <a href="/post/88737">Files open twice</a>:</p>
<blockquote>
<p dir="auto">I’ve opened an issue for this: <a href="https://github.com/notepad-plus-plus/notepad-plus-plus/issues/14030" rel="nofollow ugc">Symbolic links and hard links can result in the same physical file being open in multiple tabs</a>.</p>
</blockquote>
<p dir="auto">It seems the matter is not as straightforward as it appeared to me. At least one person strongly disapproves of changing the current behavior at all.</p>
<p dir="auto">I don’t really use symlinks. If some of you do, and have clear ideas about how they should work — whether they should resolve to the target name, like a shortcut, or remain as their own name in their own directory, like a hard link — you might be able to contribute to the discussion at the link above.</p>
<p dir="auto">Three notes:</p>
<ol>
<li>
<p dir="auto">I offered a pull request along with the issue, but another user (the same one who objects to changing anything) discovered an important flaw. While that’s mixed up in the discussion, it’s really a separate issue from what <em>should</em> happen. If we reach a consensus on what should happen, I’m sure there will be a way to fix the flaw (which causes symlinks with a <em>relative</em> path to fail completely).</p>
</li>
<li>
<p dir="auto">As things are, File|Open and double-click in Explorer behave differently than opening from the command line and right-click|Open with Notepad++ in Explorer. I see no way to change the File|Open and double-click behavior, because Windows is resolving the symlink in those cases before Notepad++ ever sees it. As far as I can tell, the person who doesn’t want things changed believes the other behavior is “correct,” and doesn’t care that the behavior in some cases doesn’t match. Honestly, the more I look at the way different programs behave, the more it seems to me there is no consistency regarding this in Windows. I’m not sure if that’s an argument for letting the chips fall where they may, or if Notepad++ should still at least be consistent with itself.</p>
</li>
<li>
<p dir="auto">Though I now think I was unwise to do so, I combined two distinct issues: opening symlinks in particular, and avoiding opening the same file by two separate names (which affects both symlinks and hardlinks). The latter is the one more directly relevant to the original complaint in this thread. The fix for that appears straightforward and is independent of the flaw that caused a problem with my pull request. (My solution just activates the tab holding a file which is already open, regardless of whether you’re trying to open it under a different name.) However, the user who does not want anything changed apparently does not want Notepad++ to suppress opening the same file under two different names either.</p>
</li>
</ol>
]]></description><link>https://community.notepad-plus-plus.org/post/88776</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/88776</guid><dc:creator><![CDATA[Coises]]></dc:creator><pubDate>Mon, 21 Aug 2023 07:05:06 GMT</pubDate></item><item><title><![CDATA[Reply to Files open twice on Sat, 19 Aug 2023 23:52:11 GMT]]></title><description><![CDATA[<p dir="auto">I’ve opened an issue for this: <a href="https://github.com/notepad-plus-plus/notepad-plus-plus/issues/14030" rel="nofollow ugc">Symbolic links and hard links can result in the same physical file being open in multiple tabs</a>.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/88737</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/88737</guid><dc:creator><![CDATA[Coises]]></dc:creator><pubDate>Sat, 19 Aug 2023 23:52:11 GMT</pubDate></item><item><title><![CDATA[Reply to Files open twice on Sat, 19 Aug 2023 21:13:45 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/general-coder" aria-label="Profile: General-Coder">@<bdi>General-Coder</bdi></a> said in <a href="/post/88715">Files open twice</a>:</p>
<blockquote>
<p dir="auto">maybe this is symbolic links issue then, I use those</p>
</blockquote>
<p dir="auto">At first I couldn’t reproduce this issue with Notepad++ 8.5.6, 64-bit, on Windows 10, then I noticed something.</p>
<p dir="auto">If you open a symbolic link using <strong>File</strong> | <strong>Open…</strong> or by double-clicking in File Explorer, the <em>target</em> name appears in the tab. When opening by command line, from the File Explorer context menu, or from the previous file history (which can happen when the symlink name is already there due to having previously opened it used one of the other two methods), the symlink name is displayed.</p>
<p dir="auto">My guess — I haven’t looked into the code — is that when Windows knows it is opening a file, it is automatically returning the target path for symlinks (as it should); but for command line and context menu, Notepad++ is just working out the fully-qualified path name of the link without checking for the file name <em>after</em> the file is open and Windows has resolved the symlink. In my opinion, this is a bug: a symlink is meant to redirect transparently to the target. (For example, the file extension on the target, not the symlink, should determine the language.) All methods of opening a symlink should give the same results.</p>
<p dir="auto">Hard links are also a problem, but a different one. I think they could be tested using <a href="https://learn.microsoft.com/en-us/cpp/standard-library/filesystem-functions?view=msvc-170#equivalent" rel="nofollow ugc">std::filesystem::equivalent</a>. Hard links shouldn’t (and logically cannot) resolve to any other file name, but an editor still shouldn’t allow the same filesystem object to be opened twice, even if it is called by different names. However, that is, at least arguably, an enhancement rather than a bug.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/88736</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/88736</guid><dc:creator><![CDATA[Coises]]></dc:creator><pubDate>Sat, 19 Aug 2023 21:13:45 GMT</pubDate></item><item><title><![CDATA[Reply to Files open twice on Sat, 19 Aug 2023 18:57:10 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/general-coder" aria-label="Profile: General-Coder">@<bdi>General-Coder</bdi></a> said in <a href="/post/88733">Files open twice</a>:</p>
<blockquote>
<p dir="auto">impression its possible for program to handle symbolic links somehow</p>
</blockquote>
<p dir="auto">By “handle”, you seem to mean “ignore their desired intent, and instead dig deep into the belly and circumvent their meaning to impose your own meaning”.  Yes, it would not surprise me if it were possible.</p>
<p dir="auto">But is it a good idea?  I don’t know, but I would doubt it.</p>
<p dir="auto">And is it worth it?  Given that I’ve been a member of the Notepad++ Community for 7.5 years, and that I’ve probably read the vast majority of the 75k posts since my first post here, and never seen it requested, I’d conclude it’s a rather niche desire.</p>
<p dir="auto">But that’s not my decision to make.  The only way we’d know for sure would be if someone made an official feature request, as <a href="https://community.notepad-plus-plus.org/topic/15741/faq-desk-feature-request-or-bug-report">described in our FAQ</a></p>
]]></description><link>https://community.notepad-plus-plus.org/post/88734</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/88734</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Sat, 19 Aug 2023 18:57:10 GMT</pubDate></item><item><title><![CDATA[Reply to Files open twice on Sat, 19 Aug 2023 18:19:06 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a>  absosolutely that seems to be the case here.</p>
<p dir="auto">And I don’t mean to blame np++ in anyway but I’m under impression its possible for program to handle symbolic links somehow. So maybe there is function somewhere that can translate “symbolic path” to the “root path”.<br />
So maybe it’s possible to improve np++ regarding this? Idk about this, just guessing</p>
]]></description><link>https://community.notepad-plus-plus.org/post/88733</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/88733</guid><dc:creator><![CDATA[General Coder]]></dc:creator><pubDate>Sat, 19 Aug 2023 18:19:06 GMT</pubDate></item><item><title><![CDATA[Reply to Files open twice on Sat, 19 Aug 2023 14:58:02 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/general-coder" aria-label="Profile: General-Coder">@<bdi>General-Coder</bdi></a> said in <a href="/post/88717">Files open twice</a>:</p>
<blockquote>
<p dir="auto">the paths are different only filename is same. so its the symbolic link that causes it</p>
</blockquote>
<p dir="auto">Yes, it’s the symbolic link that causes the problem.  Because a symbolic link is the contract between you (the user who created the symbolic link) and the OS to (effectively) lie to applications about where the file really is.</p>
<p dir="auto">The OS is honoring its part of that contract, and so it convinces Notepad++ that the file is at <code>c:\path\to\symlink\file</code> instead of the real path <code>c:\path\to\real\file</code> .  Oddly, Notepad++ believes the OS when it says <code>c:\path\to\symlink\file</code> is the path to this file.  And thus when Notepad++ searches through its internal list of already-open files, which contains <code>c:\path\to\real\file</code> but not <code>c:\path\to\symlink\file</code> , it says “I don’t have <code>c:\path\to\ssymlink\file</code> open yet, so I will open it.”</p>
<p dir="auto">Don’t be surprised when the OS honors its contract with you, and Notepad++ takes the OS at its word.</p>
<p dir="auto">If you want Notepad++ to behave like it’s the same file, either open it using the same path, or use a Windows Shortcut (.lnk file) instead of a symlink (because Shortcut files work differently, and Windows actually tells the application: “I know you said you wanted open <code>c:\path\to\shortcut.lnk</code>, but the path you are really opening is <code>c:\path\to\real\file</code>”)</p>
<p dir="auto">The fault is not in Notepad++, but in the very definition of what a Windows Symbolic Link is and how it is intended to be used.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/88724</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/88724</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Sat, 19 Aug 2023 14:58:02 GMT</pubDate></item><item><title><![CDATA[Reply to Files open twice on Sat, 19 Aug 2023 13:18:59 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-Kilborn">@<bdi>Alan-Kilborn</bdi></a> don’t know what details I can provide?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/88721</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/88721</guid><dc:creator><![CDATA[General Coder]]></dc:creator><pubDate>Sat, 19 Aug 2023 13:18:59 GMT</pubDate></item><item><title><![CDATA[Reply to Files open twice on Sat, 19 Aug 2023 13:13:01 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/general-coder" aria-label="Profile: General-Coder">@<bdi>General-Coder</bdi></a> said in <a href="/post/88719">Files open twice</a>:</p>
<blockquote>
<p dir="auto">dunno where’s the fault at, seems unfixable</p>
</blockquote>
<p dir="auto">Well if you provided more details, we’d be able to tell you if it Notepad++ or not, otherwise, you’re on your own.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/88720</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/88720</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Sat, 19 Aug 2023 13:13:01 GMT</pubDate></item><item><title><![CDATA[Reply to Files open twice on Sat, 19 Aug 2023 12:37:54 GMT]]></title><description><![CDATA[<p dir="auto">dunno where’s the fault at, seems unfixable…</p>
]]></description><link>https://community.notepad-plus-plus.org/post/88719</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/88719</guid><dc:creator><![CDATA[General Coder]]></dc:creator><pubDate>Sat, 19 Aug 2023 12:37:54 GMT</pubDate></item><item><title><![CDATA[Reply to Files open twice on Sat, 19 Aug 2023 12:35:00 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/general-coder" aria-label="Profile: General-Coder">@<bdi>General-Coder</bdi></a> said in <a href="/post/88717">Files open twice</a>:</p>
<blockquote>
<p dir="auto">the paths are different only filename is same. so its the symbolic link that causes it</p>
</blockquote>
<p dir="auto">Thus, this does not sound like a Notepad++ problem.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/88718</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/88718</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Sat, 19 Aug 2023 12:35:00 GMT</pubDate></item><item><title><![CDATA[Reply to Files open twice on Sat, 19 Aug 2023 12:30:28 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-Kilborn">@<bdi>Alan-Kilborn</bdi></a> said in <a href="/post/88716">Files open twice</a>:</p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/general-coder" aria-label="Profile: General-Coder">@<bdi>General-Coder</bdi></a></p>
<p dir="auto">What is the path to each of the tabs that get created?  Should be the same if what you say is happening truly is; but this forces you to check…</p>
<p dir="auto">Use the Window menu’s Windows command to see the paths.</p>
</blockquote>
<p dir="auto">the paths are different only filename is same. so its the symbolic link that causes it</p>
]]></description><link>https://community.notepad-plus-plus.org/post/88717</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/88717</guid><dc:creator><![CDATA[General Coder]]></dc:creator><pubDate>Sat, 19 Aug 2023 12:30:28 GMT</pubDate></item><item><title><![CDATA[Reply to Files open twice on Sat, 19 Aug 2023 12:27:23 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/general-coder" aria-label="Profile: General-Coder">@<bdi>General-Coder</bdi></a></p>
<p dir="auto">What is the path to each of the tabs that get created?  Should be the same if what you say is happening truly is; but this forces you to check…</p>
<p dir="auto">Use the Window menu’s Windows command to see the paths.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/88716</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/88716</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Sat, 19 Aug 2023 12:27:23 GMT</pubDate></item><item><title><![CDATA[Reply to Files open twice on Sat, 19 Aug 2023 12:25:44 GMT]]></title><description><![CDATA[<p dir="auto">maybe this is symbolic links issue then, I use those</p>
]]></description><link>https://community.notepad-plus-plus.org/post/88715</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/88715</guid><dc:creator><![CDATA[General Coder]]></dc:creator><pubDate>Sat, 19 Aug 2023 12:25:44 GMT</pubDate></item><item><title><![CDATA[Reply to Files open twice on Sat, 19 Aug 2023 12:26:35 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/general-coder" aria-label="Profile: General-Coder">@<bdi>General-Coder</bdi></a> said in <a href="/post/88713">Files open twice</a>:</p>
<blockquote>
<p dir="auto">Maybe it’s my C# code that somehow makes the file open twice</p>
</blockquote>
<p dir="auto">I can’t see how that would cause it…</p>
]]></description><link>https://community.notepad-plus-plus.org/post/88714</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/88714</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Sat, 19 Aug 2023 12:26:35 GMT</pubDate></item><item><title><![CDATA[Reply to Files open twice on Sat, 19 Aug 2023 12:20:18 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-Kilborn">@<bdi>Alan-Kilborn</bdi></a> said in <a href="/post/88711">Files open twice</a>:</p>
<blockquote>
<p dir="auto">Notepad++ has logic to keep this from happening; if you open an already existing file it should just activate the previously open tab for it, not create another tab (if that’s what you mean by “open twice”).</p>
</blockquote>
<p dir="auto">that’s what I expected to happen, not open it twice</p>
<p dir="auto">Maybe it’s my C# code that somehow makes the file open twice</p>
<pre><code>ProcessStartInfo startInfo = new ProcessStartInfo();
     startInfo.CreateNoWindow = true;
     startInfo.UseShellExecute = false;
     startInfo.FileName = filename;
     startInfo.WindowStyle = ProcessWindowStyle.Normal;

     startInfo.Arguments = args;

    using (Process exeProcess = Process.Start(startInfo))
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/88713</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/88713</guid><dc:creator><![CDATA[General Coder]]></dc:creator><pubDate>Sat, 19 Aug 2023 12:20:18 GMT</pubDate></item><item><title><![CDATA[Reply to Files open twice on Sat, 19 Aug 2023 11:41:42 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/general-coder" aria-label="Profile: General-Coder">@<bdi>General-Coder</bdi></a> said in <a href="/post/88705">Files open twice</a>:</p>
<blockquote>
<p dir="auto">if the file i want to open is already open in np++ the file will be open twice</p>
</blockquote>
<p dir="auto">Notepad++ has logic to keep this from happening; if you open an already existing file it should just activate the previously open tab for it, not create another tab (if that’s what you mean by “open twice”).</p>
<p dir="auto">I think you need to provide more specifics for anyone to try to shed some light on what you’re seeing happen.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/88711</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/88711</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Sat, 19 Aug 2023 11:41:42 GMT</pubDate></item></channel></rss>