我用的是推手和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()
})发布于 2018-07-06 11:26:10
问题在于xterm-滚动区。它在背后隐藏数据。我已经将样式选项设置为postion:absolute; z-index:0;,它起了作用。
https://stackoverflow.com/questions/51025555
复制相似问题