Issue with 'asNotepad.xml' file.

  • So. I want to disable tabbed browsing in Notepad++.

    I discovered that an empty ‘asNotepad.xml’ file can be placed in the same folder as the Notepad++ folder.
    It looks like this auto hides the tabbed browsing bar on launch, even though it is still there and the things you open get added to the tabs list, and worse, when you right click the file you want to open and click ‘Edit with Notepad++’ it opens that file in the tab list and does not switch to it so you are now staring at the older file that you launched…

    This is just horrible, notepad.exe is not problematic in this regard.
    So, can we make notepad++ act just like notepad.exe correctly?


  • @SalviaSage said:

    I want to disable tabbed browsing in Notepad++

    Rather core to Notepad++. This is pretty much like wanting a car without wheels. Maybe every file in single instance mode…but I cringe at the thought of that.

    can we make notepad++ act just like notepad.exe

    We can’t, really…but we don’t have to. There is already a solution: Recommend that you simply use notepad.exe


  • I do use notepad.exe by the way, for opening .txt files for example.
    But, I don’t use that for programming.

    Notepad++ is better for that purpose, but I just can not warm up to its tabbed browsing features, I feel it is worse for my productivity etc.

    So, yeah, how can we open every file in single instance mode then and disable tabbed browsing? If you know how, please share. thanks. : )

  • @SalviaSage

    If you know how, please share

    I don’t…maybe someone else.

    Often on this site, I’ll delve into other people’s raised issues and look into solutions, mainly because I find it interesting and possibly useful to me as well. This one I just can’t get into because I have no interest in it and see no value in “pulling the wheels” off of such a core Notepad++ feature. Good luck in your investigation.

  • Hello, @salviasage, @scott-sumner and All,

    Not completely sure, but you don’t need the zero-length asNotepad.xml file ! Simply :

    • Close any instance of N++, first

    • Open a CMD console window

    • Type in the command notepad++ -nosession -notabbar and valid

    Note :

    The new 1 file is opened, by default !



  • Great idea. Here are a few possible tweaks:

    • If you add in -multiInst, then it doesn’t matter if you have another N++ window already open: notepad++ -nosession -notabbar -multiInst.

    • If you don’t want to have to open a CMD or PowerShell console window, you can just use the windows Run menu (START menu, type run; or just type WinKey+R)

    • If you edit your file association(s) and/or right-click context menu entries in the registry from "c:\program files (x86)\Notepad++\notepad++.exe" "%1" to "c:\program files (x86)\Notepad++\notepad++.exe" -nosession -notabbar -multiInst "%1", then it will become your default behavior

  • yeah but, those do not launch the file, still the file 1 gets opened… which is wrong because i am clicking on “edit with notepad++” on a specific file, that file just gets opened at another tab, so the tabbed browsing feature is still there, only hidden.

    So, there is no way to disable tabbed browsing:?
    Or perhaps, you could make a suggestion on using tabs differently.

  • I didn’t change my association… but when I did those from the command line or the run menu, they opened the file in a new instance

  • Did you try just the registry, just the command line, just the run menu, or some of all. What were the exact commands you used? (maybe come up with dummy paths/names, if you need to keep such information confidential… but make sure it’s easy for us to distinguish: “file 1” and “specific file” aren’t very helpful in telling which is which.)

    If you tried the registry change: Which registry entry / entries did you change? And to what, exactly? Maybe you missed one (which happened to be the critical one), or had a typo.

  • @SalviaSage,

    I experimented a bit this morning, and this replicated the behavior that I believe you want:

    1. Run regedit
    2. Navigate to KEY_CLASSES_ROOT\*\shell
    3. LeftPane: RightClick on shell, New > Key = SingleTabNotepad++
    4. LeftPane: LeftClick (select) SingleTabNotepad++
    5. RightPane: set (Default) to Open with new Single-tabbed Notepad++ instance
    6. LeftPane: RightClick on SingleTabNotepad++, New > Key = command, and select
    7. LeftPane: LeftClick (select) command
    8. RightPane: set (Default) to "c:\program files (x86)\Notepad++\notepad++.exe" -nosession -notabbar -multiInst "%1" (make sure to include the shown capitalization of options, and the quotes around the executable path [if it has spaces] and around the %1 [because filename will often have spaces])
    9. Exit registry editor
    10. You may have to log off and back on, or reboot (or, if you have NirSoft’s nircmd tool, you can use nircmd shellrefresh and nircmd sysrefresh to force registry changes to take effect immediately)

    At this point, whether I have my normal multi-tabbled single-instance Notepad++ currently running or not:

    • if I right click on a file in Windows Explorer, and select Open with new Single-tabbed Notepad++ instance, it opens that one file in a new instance of Notepad++ without a tabbar
    • if I ctrl-click on two different files in Windows Explorer, and select Open with new Single-tabbed Notepad++ instance, it opens those two files in two separate insatance of Notepad++ without tabbars
    • if I drag a file into my normal tabbed instance of Notepad++, it properly opens it in that instance

    There is a caveat to doing it this way – as there will be in any configuration when you’re trying to avoid the normal functionality of an application:

    • if you try to use File > Open in one of the single-tabbed instances of Notepad++, it will open the new file in the same instance of your single-tabbed Notepad++, hiding your older file. Both are accessible through that instance’s Window menu.

    I had hoped that combining that with the asNotepad.xml would give a more-unified notepad-like experience, where each File>Open would also open a new instance.

    I thought maybe changing Settings > Preferences > Multi-Instance to “always in multi-instance” would do it… but no.

    I did a quick search through the source code for the asNotepad.xml, and all that does is set three parameters

    if (pNppParameters->asNotepadStyle())
        isMultiInst = true;
        cmdLineParams._isNoTab = true;
        cmdLineParams._isNoSession = true;

    The isMultiInst appears to only be used during the WinMain() function, so only when it’s deciding whether to create a brand-new window, or attach to an existing window; so that won’t be triggered during File > Open.

    At this point, if the workarounds listed here do not do what you want, you’ll have to add a feature request. If you do, be explicit about what you want. If it were me who wanted such a feature (and I don’t; I think tabbed browsing is significantly more efficient than multiple independent windows: if I have 10 files open in Notepad++, I’d much rather the organizing of those 10 files is handled inside of Notepad++, rather than having to go to the task bar and look through the 10 instances of Notepad++ stacked there to find the one file I want) – but if it were me, I’d try to phrase it something like “I like the idea of the asNotepad.xml feature, where Notepad++ is automatically launched in -multiInst -nosession -notabbar mode, but I’d also like it to have the additional features that 1) when I right click in Windows Explorer and select Open In Notepad++, that it would open in another new single-tabbed instance of Notepad++ (currently, it adds it to one of my existing instances, which hides the tab that was already open, defeating the purpose of the asNotepad.xml, IMHO); also, that when I use File>Open from one of thes asNotepad.xml windows, it should open it in a new instance rather than in the existing instance, for similar reasons.”.

    I don’t guarantee this will get implemented*, but it’s your best chance for it, if the workarounds presented here are not sufficient for you. (*: in fact, given that the asNotepad.xml feature was added in v4.8 back in 2008, I doubt much effort will be added to that ancient feature.)

  • (okay, so reading it some time later, I actually should have included the “2)” in my example phrasing… I am sure you can tell where it was intended.)

  • Wow. Great post @PeterJones.

    You may not know this, but editing the windows registry is one of my strongest areas on computers. So it was a breeze for me to recreate what you have said here.

    This method is superior to creating a asNotepad.xml file in the Notepad++ directory because that does not open the file that you want to open in the viewing tab but only loads it into the tab bar so you are left staring at an older file that you opened which is definitely not what the user wants.

    Also, this option still allows you to open things in the regular, sessioned and tabbed notepad++ while giving you another option in the right click menu to open things in a single tabbed format just like notepad.exe

    So, if you also want notepad++ to work like this, I created a .reg file, just create a file that ends with the .reg extension and copy paste the following in to it.

    Windows Registry Editor Version 5.00
    @ = "Edit with Notepad++ (Single Tab)"
    @ = "\"c:\\program files (x86)\\Notepad++\\notepad++.exe\" -nosession -notabbar -multiInst \"%1\""

    This will give you an option on top of the default “Edit with Notepad++” to use notepad++ without the sessions or tabs and will open the files separately just like in notepad.exe (without changing any default notepad++ behaviour)

    Thanks to everyone who replied!

Log in to reply