This is the code for autoresize. Due to a stupid mudlet behaviour, I'm not 100% sure that it won't induce crashes