xtermjs / xterm.js

A terminal for the web
https://xtermjs.org/
MIT License
17.04k stars 1.6k forks source link

xterm 渲染不全 #4992

Closed enjoy-myLife closed 4 months ago

enjoy-myLife commented 4 months ago

Details

Steps to reproduce

  1. 附件文本
  2. rows为很小的数字比如5

const initTerm = () => { term.value = new Terminal({ cols:102, rows:5, fontSize: 14, fontFamily: "Monaco, Menlo, Consolas, 'Courier New', monospace", }); term.value.open(terminal.value); //挂载dom窗口 // term.value.loadAddon(fitAddon); //自适应尺寸 // 不能初始化的时候fit,需要等terminal准备就绪,可以设置延时操作

term.value.onRender(() => {
    // fitAddon.fit();
});
termData(); //Terminal 事件挂载

};

// 终端输入触发事件 const termData = () => { // 输入与粘贴的情况,onData不能重复绑定,不然会发送多次 term.value.onData((data: string) => { emits('onData', data); }); };

onMounted(() => { initTerm(); setTimeout(()=>{ term.value.write(附件文本) },5000) });

xterm不能将文本渲染完全,在开发者工具里面甚至很多文本没有渲染

enjoy-myLife commented 4 months ago

image

这已经是滚动到最顶部了

enjoy-myLife commented 4 months ago

oh my god!!! After reading the source code of xterm, I learned that the default scrollback is 1000; https://github.com/xtermjs/xterm.js/issues/518 I hope the author will mark it on the document or in the comments of the ts file. It is too difficult to find.

Tyriar commented 4 months ago

Adding in https://github.com/xtermjs/xterm.js/pull/4993 👍