Files from sessions are 'lost' when a session file is opened and not connected to the VPN that was connected but dropped.
-
I have used Notepad++ for over 10 years.
If you can come up with a subscription service I’d feel better but of late I’m getting sick of loosing my work when the VPN to work goes down. I’ve learned to use sessions in a very poor manner: to identify a local subdirectory where I put all my session files (using .np++s as the custom extension). Then I put another file using the same name with a .txt extension.
I put the command to open the session in the text file and save the session when I’m done for the day.
%NP++% -noPlugin -openSession
\dwp0178\c$\Users\srhoads1\Documents\NP++Sessions!_hshome01_BaseSession.np++s -titleAdd=“!_hshome01_BaseSession.np++s”This is the one area that wastes more of my time than is conceivable when the content of one of these files (or like this morning both that I’m down to were lost) when I started work and signed into the vpn, then opened my base session, and then it showed me that the vpn connection had failed so lost that session (it only opens the local files and even if I close the session, reconnect to the vpn and then again open the session the files not opened the last time are no longer present in the session file so have to go piece together my session.
Just a terrible waste of time.
Somehow I really blew it this morning and lost both of my sessions.
I use sessions to have sets of files open on a subject but used to have perhaps as many as 10 projects open over the course of a week but if the company pushed a reboot (no warnings and they don’t keep to the stated schedule) I would lose un-saved files but for many months now the session files are the new big problem. I measure my work now and logoff daily (so have to name files and save them so that problem is over) but now am down to 0 good session files.
I hate to complain but my workflow over the last few years has deteriorated to this dismal failure.
I’d love to be able to open a session and have its name appear at the top of the screen and for Notepad++ to save it as often as it saves files and not drop files that aren’t available when a session is opened!
I hate that the session files themselves are binary and not something I can manually re-create or I’d just write a script to re-create them daily from my own session files.I can’t even see a good way to open multiple files to manage my own sessions.
I use files from many locations (many URLs to server fileshares and NAS shares) so I don’t have to re-invent or copy things between projects.
If anyone is listening?
-
If anyone is listening?
Everyone in this forum is a fellow user of Notepad++, as was explained in the Please Read This Before Posting which it appears you neglected to read before posting.
And anyone here who reads your post is either interested in helping you, or is lurking for unknown reasons. But yes, if your post has at least one view, then there is someone “listening”. But if you expect this post to be read by the primary developer of Notepad++, then you did not read and understand the “Please Read Before Posting” and the other FAQs it directed you to.
If you can come up with a subscription service I’d feel better
There is no paid version of Notepad++, and there never will be, subscription or otherwise. There is no way to pay for better service or better performance out of Notepad++, as Notepad++ is a 100% volunteer-run, volunteer-coded open-source application.
I can’t even see a good way to open multiple files to manage my own sessions.
You might try using the Session Manager plugin, which has a lot of features to help manage sessions. And I don’t think it automatically deletes the non-existent files from Session Manager sessions, so that would probably help you (but I’m not a Session Manager user, so I cannot be 100% sure). And that plugin does have an option to include the session name in the Notepad++ title bar. It really sounds like that plugin would be a good solution for you.
Alternately, the Project Panels feature of Notepad++ is an alternative to sessions, which stores groups of files as a “project” and allows you to easily manage things within that project; given you are working with multiple projects, that might be an alternate interface that you might like. Instead of putting the project name in the title bar, it puts it in the project panel, but that should still help you see which project is active at any given time.
I hate that the session files themselves are binary and not something I can manually re-create or I’d just write a script to re-create them daily from my own session files.
Then you should hate your misunderstanding. Notepad++ session files are XML files, not binary files. You could create a script that creates a session file as appropriately-defined XML, and then load that session from Notepad++ with no problem whatsoever.
An example of this session XML format is shown below.
<?xml version="1.0" encoding="UTF-8" ?> <NotepadPlus> <Session activeView="0"> <mainView activeIndex="0"> <File firstVisibleLine="0" xOffset="0" scrollWidth="1259" startPos="0" endPos="0" selMode="0" offset="0" wrapCount="1" lang="Markdown (preinstalled)" encoding="-1" userReadOnly="no" filename="c:\path\to\first.md" backupFilePath="" originalFileLastModifTimestamp="-658467239" originalFileLastModifTimestampHigh="30964547" mapFirstVisibleDisplayLine="-1" mapFirstVisibleDocLine="-1" mapLastVisibleDocLine="-1" mapNbLine="-1" mapHigherPos="-1" mapWidth="-1" mapHeight="-1" mapKByteInDoc="512" mapWrapIndentMode="-1" mapIsWrap="no" /> <File firstVisibleLine="0" xOffset="0" scrollWidth="1" startPos="0" endPos="0" selMode="0" offset="0" wrapCount="1" lang="None (Normal Text)" encoding="-1" userReadOnly="no" filename="c:\path\to\second.txt" backupFilePath="" originalFileLastModifTimestamp="-635668312" originalFileLastModifTimestampHigh="30964547" mapFirstVisibleDisplayLine="-1" mapFirstVisibleDocLine="-1" mapLastVisibleDocLine="-1" mapNbLine="-1" mapHigherPos="-1" mapWidth="-1" mapHeight="-1" mapKByteInDoc="512" mapWrapIndentMode="-1" mapIsWrap="no" /> </mainView> <subView activeIndex="0" /> </Session> </NotepadPlus>
As the online user manual says in the “Sessions” section, if you have set the Settings > Preferences > MISC > Session file ext. to auto-associate
.np++s
files as a session, then notepad++ will treat it as a session, rather than opening the raw XML file (which explains why you cannot edit the session file that you named*.np++s
file directly in Notepad++, and maybe explains why you mistakenly think that session files are binary, even though they are text-based XML files). So if you want to edit the session file in Notepad++, you have to (temporarily or permanently) undo that Preference to allow Notepad++ to open the session*.np++s
XML files as text and edit them. But if you’re doing a script to create them, then you don’t have to bother with turning off that feature.References:
-
Thank you for taking the time to respond to issues.
I wish I could program at the level necessary to work on Notepad++ but my job keeps me sufficiently busy that isn’t practical. Hence my desire to pay for what I need.
The last time I checked the Session Manager plugin it was very old and appeared to be out of date (and didn’t help much).
Yes, not binary but XML but that is bloated and more than I’m ready to write code to manage. JSON seems the better approach but whatever is in use is hard to move away from. But again requires more than I can invest to program.
Thank you for mentioning the Projects feature – haven’t noticed or tried that so will look into it.
I revisited the command-line but no way to open files into an existing session – I don’t see a way to name one session from another nor to use it when opening a file to add files to an open session (not using the -openSession command-line parameter). That would have enabled simple scripting to manage sets of files just using batch or simple powershell scripts.
Wish there was a preference setting for sessions files not to forget files. Perhaps a way to prevent sessions from being opened when some files are not available (perhaps with an option to open what is available or quit to get on the VPN).
And I have see the please read business but have not before gotten much help so making a last ditch attempt did payoff with your tips.
Thanks.
-
I tried the following:
- Create 6 text files,
a.txt
,b.txt
, …,f.txt
. - Open them all into Notepad++.
- Exit Notepad++ (note: default session file
session.xml
gets saved with 6 files in it). - Move
b.txt
,d.txt
andf.txt
into a different folder than where they originated. - Run Notepad++ (original
session.xml
is used, but only the 3 files that can be located –a.txt
,c.txt
,e.txt
– are now opened into it). - Move
b.txt
,d.txt
andf.txt
back into their folder of origination. - Use File > Load Session… and select
session.xml
. (Or, equivalently, open a CMD window and runnotepad++ -openSession session.xml
). - Observe that the original six files are now loaded in Notepad++.
This worked for me.
I would think that if the first “move” was replaced with “disconnect VPN” and the second “move” was replaced with “reconnect VPN”, it would work equivalently, but I don’t know, maybe there is some quirk when dealing with a non-local file system.Of course, to use this technique, you’d have to actually notice that all of your intended files did not get loaded, before exiting Notepad++…
- Create 6 text files,
-
@Alan-Kilborn said:
I tried the following
I should add that I tried this with Notepad++ default settings in effect. Default includes “mono-instance”:
If another setting for this is chosen, my experiment probably doesn’t work.
I avoid multi-instance mode of Notepad++ because I see no advantage to it, and IMO there are logistical problems with it.
-
I created issue #12079 asking for a fix to allow temporarly-missing files to stay in the session.
-