xterm fix
/ mirror_to_github (push) Successful in 20s Details
/ test (push) Successful in 5s Details

This commit is contained in:
Leon van Kammen 2024-09-24 16:29:59 +00:00
parent eb086dfd74
commit c6ce294e69
2 changed files with 13 additions and 13 deletions

View File

@ -45,7 +45,8 @@ ISOTerminal.addEventListener('emulator-started', function(){
}); });
window.addEventListener('unhandledrejection', function(event) { 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) // enable/disable logging file (echo 1 > mnt/console.tty)

View File

@ -27,24 +27,23 @@ ISOTerminal.prototype.xtermInit = function(){
}) })
term.onRender( () => { term.onRender( () => {
return
// xterm relies on requestAnimationFrame (which does not called in immersive mode) // xterm relies on requestAnimationFrame (which does not called in immersive mode)
let _window = term._core._coreBrowserService._window let _window = term._core._coreBrowserService._window
if( !_window.requestAnimationFrameAFRAME ){ // patch the planet! if( !_window.requestAnimationFrameAFRAME ){ // patch the planet!
_window.requestAnimationFrameAFRAME = function(cb){ // _window.requestAnimationFrameAFRAME = function(cb){
if( term.tid != null ) clearTimeout(term.tid) // if( term.tid != null ) clearTimeout(term.tid)
term.tid = setTimeout( function(){ // term.tid = setTimeout( function(){
console.log("render") // console.log("render")
// cb()
// term.tid = null
// },100)
// }
_window.requestAnimationFrameAFRAME =
AFRAME.utils.throttleLeadingAndTrailing( function(cb){
cb() cb()
term.tid = null },150 )
},100)
}
//_window.requestAnimationFrameAFRAME =
// AFRAME.utils.throttleLeadingAndTrailing( function(cb){
// cb()
// },150 )
// we proxy the _window object of xterm, and reroute // we proxy the _window object of xterm, and reroute
// requestAnimationFrame to requestAnimationFrameAFRAME // requestAnimationFrame to requestAnimationFrameAFRAME