diff --git a/com/isoterminal/feat/jsconsole.js b/com/isoterminal/feat/jsconsole.js index 84c6dfa..f8f73bb 100644 --- a/com/isoterminal/feat/jsconsole.js +++ b/com/isoterminal/feat/jsconsole.js @@ -45,7 +45,8 @@ ISOTerminal.addEventListener('emulator-started', function(){ }); window.addEventListener('unhandledrejection', function(event) { - console.error('Unhandled promise rejection:', event.reason); + console.error('Unhandled promise rejection:') + console.error(event.reason); }); // enable/disable logging file (echo 1 > mnt/console.tty) diff --git a/com/isoterminal/feat/xterm.js b/com/isoterminal/feat/xterm.js index c771944..9e7d265 100644 --- a/com/isoterminal/feat/xterm.js +++ b/com/isoterminal/feat/xterm.js @@ -27,24 +27,23 @@ ISOTerminal.prototype.xtermInit = function(){ }) term.onRender( () => { - return // xterm relies on requestAnimationFrame (which does not called in immersive mode) let _window = term._core._coreBrowserService._window if( !_window.requestAnimationFrameAFRAME ){ // patch the planet! - _window.requestAnimationFrameAFRAME = function(cb){ - if( term.tid != null ) clearTimeout(term.tid) - term.tid = setTimeout( function(){ - console.log("render") +// _window.requestAnimationFrameAFRAME = function(cb){ +// if( term.tid != null ) clearTimeout(term.tid) +// term.tid = setTimeout( function(){ +// console.log("render") +// cb() +// term.tid = null +// },100) +// } + _window.requestAnimationFrameAFRAME = + AFRAME.utils.throttleLeadingAndTrailing( function(cb){ cb() - term.tid = null - },100) - } - //_window.requestAnimationFrameAFRAME = - // AFRAME.utils.throttleLeadingAndTrailing( function(cb){ - // cb() - // },150 ) + },150 ) // we proxy the _window object of xterm, and reroute // requestAnimationFrame to requestAnimationFrameAFRAME