Linqpad doesn't reopen saved open files
Hi!
The "Always shelve changes on exit" option works fantastically. I've got some unsaved playground windows which are reopened every time I start Linqpad. But if I give them a name and save, and then quit Linqpad, they won't reopen automatically on next Linqpad launch. Only unsaved files will reappear.
Can I please ask for a feature that all open files, not only those shelved, are reopened automatically when starting Linqpad, no matter if they're saved or dirty? I'd like to preserve all my open tabs.
Thanks in advance.
Comments
-
Yeah, kinda losing my mind as to why this isn't a feature - most apps do this by default, and I'm surprised this feature wasn't already baked-in back in 'Nam.
-
Here is my workaround:
string appDataRoamingPathWithLINQPad = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "LINQPad", "RecentQueries.txt"); File.ReadAllLines(appDataRoamingPathWithLINQPad).ToList().ForEach(item => Util.OpenQuery(item));
Util.OpenQuery(you can pass in any list of files to reopen.)
You might need a delay if opening more than 10 or so.
-
Came here from Google. I also don't understand why LinqPad does not have a checkbox "Restore previous session".
Chrome, VisualStudio, VisualStudioCode all re-open the tabs that were open when you closed the app.
Related posts:
Vote issues:
-
I understand you're looking for a build-in feature but you can recreate the feature yourself. This can be more powerful because you can use any list of files.
Create a shortcut for LINQPad 7:
In the target add this:
C:\LINQPad7-Beta\LINQPad7-x64.exe C:\linqpad\queries\reopen-recent-files-script.linq -run
Inside of the file, C:\linqpad\queries\reopen-recent-files-script.linq add code:
string appDataRoamingPathWithLINQPad = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "LINQPad", "RecentQueries.txt"); File.ReadAllLines(appDataRoamingPathWithLINQPad).ToList().ForEach(item => Util.OpenQuery(item));
Now that shortcut will open all your recent files stored by LINQPad.
-
@stephensmitchell said:
I understand you're looking for a build-in feature but you can recreate the feature yourself...Yes, built-in would be nice, but your "hack" is also sufficient for my needs - so thank you for that!
The only thing that isn't awesome is that LINQPad always opens and includes the "reopen-recent-files-script.linq" query in the open files, but for now this isn't too bad. Unfortunately, there's no Util.CloseQuery which would allow for self-closing it.
-
FYI, this feature is built into LINQPad 8.