resize pty on process.resize
make keycode comply to strict code