I done it now, so i don't forget, actually in putty and in some case we have command after connectionns where you can send command just after connection, can we have a tab commands just before deconnection.
So you can send this command before you leave the windows for exemple putty and some other online telnet etc...
In the Events section, there's a Before Disconnect and After Disconnect tab.
Is this what you are looking for?
Although our various support queues will be monitored for emergencies, Devolutions' offices will be closed on June 24 and July 1st, 2019.
We will have to see if it is possible to do this for the PuTTY entry type. For now the best workaround is using the Events tab like Jean-François suggested.
The change has been done for the SSH Shell entry type and it will be available in RDM 12.