Я использую pusher и xtermjs.Для небольших выходов для таких команд, как w
или free -m
, все работает нормально.Для больших выходов для команд ps -aux
это не работает.Вывод отображается в консоли браузера, но не в выводе xtermjs div.
Вот мой обработчик событий-толкачей.
this.term = new Terminal({
debug: true,
allowTransparency: true,
applicationCursor: true,
applicationKeypad: true,
normalFontWeight: 100,
fontSize: 14,
cursorBlink: true,
cursorStyle: 'block', // “block” | “underline” | “bar” *
})
this.term.open(document.getElementById(this.outputDiv))
this.term.fit()
let screenObject = this
let terminalObj = this.term
window.UserChannel.bind('com.testing.command.result', function (data) {
// console.log(data)
let text = data.payload.replace(/\n/g, '\r\n')
terminalObj.writeln(text)
// terminalObj.fit()
// screenObject.hideHelpers()
})