I've used code that store commands (in jQuery Terminal) that need to be executed as JSON array in hash. with code like this:
function exec_hash() { if (location.hash) { var commands; try { commands = $.parseJSON(location.hash.replace(/^#/, '')); $.each(commands, function(i, command) { try { terminal.exec(command); } catch(e) { var cmd = $.terminal.escape_brackets(command); var msg = "Error while exec with command " + cmd; terminal.error(msg).error(e.stack); } }); } catch (e) { //invalid json - ignore } } } And i had this idea to store entire terminal session in hash, so my question is how long url hash can be?