Closed duckinator closed 7 years ago
A tad hacky, but this will work for exit/Ctrl+d:
function exit_unixkcd() {
history.back(); // Go back if you can, do nothing otherwise
setTimeout('document.location = "http://xkcd.com";', 500); // If we're still here in 1/2 a second, go to xkcd.com
}
Note: the time (500) can likely be changed, i just tried that and it worked
You can hack that in to your local copy by doing:
TerminalShell.commands['logout'] = exit_unixkcd;
(That's how i've got mine set up.)
Handling Ctrl-D requires hacking cli.js. Search for 'h' (with the quotes) and you'll find it. Making those mappings configurable from client code is on my TODO list.
I think exit or Ctrl+d should go to the previous page. And, if there is no previous page go back to xkcd.com (default page, not unixkcd)