Remember last used session

kalvaro's profile image kalvaro posted 11 years ago in General Permalink
HeidiSQL seems to remember the last connection you opened so it's selected (and parent folders expanded) when you get back to session manager. This is a great feature.

However, I have the impression that this value is saved to Windows registry only when you close the program. If you spend a while working with HeidiSQL and switching sessions you always get as default the last database session (even if you haven't connected to it a single time since you launched HeidiSQL).

May I suggest to enhance this? Not fully sure of the best algorithm but storing the value when you open a session looks like a good start.
ansgar's profile image ansgar posted 11 years ago Permalink
Sure, this is something I always wanted to enhance. Only that's quite tricky, at least when you have more than one HeidiSQL instances running.

Assuming you start instance #i1, connected to session #s1 and #s2. Now, start another instance, we call it #i2, and connect there to #s3 only. When you close #i2, and #i1 is still running, we need to save the last sessions when closing #i1, otherwise #i2 with its #s3 would win. So, saving at application exit is still valid, but I guess I just need to store the remembered sessions also when connecting and disconnecting.
ansgar's profile image ansgar posted 11 years ago Permalink
Hm.. I think I'm missing something here, do I?
kalvaro's profile image kalvaro posted 11 years ago Permalink
In your scenario, see nothing wrong in getting #s3 next time. After all, it's the last session I started.

Another possibility would be to store sessions when you start and when you close them but that'd be more complicate because you don't necessarily close them one by one using the "Disconnect" button, you can simply close HeidiSQL while several options are open. But I think it's a good option too.

(BTW, the "Disconnect" button does not have a tooltip.)
ansgar's profile image ansgar posted 11 years ago Permalink
Ok, the disconnect button now has a hint, thanks for the hint :)

So, I'll go and store last sessions when you a) close the application and b) when connecting to one session. I think that should make it most usable in the end.
Code modification/commit from ansgar.becker, 11 years ago, revision 7.0.0.4339
Store last sessions also when connecting to an additional session, not only when closing the program. See http://www.heidisql.com/forum.php?t=12149
ansgar's profile image ansgar posted 11 years ago Permalink
Done in r4339.
kalvaro's profile image kalvaro posted 11 years ago Permalink
I've had to switch to Oracle for the last weeks so I couldn't test it as thoroughly as I wanted but HeidiSQL looks quite more usable so far. Thanks a lot!

Please login to leave a reply, or register at first.