watch terminal sessions in javascript