Open alanhe421 opened 2 years ago
term._core._renderService._renderer.dimensions.actualCellWidth
term.onSelectionChange(() => {
});
term.buffer.active.cursorX
term.buffer.active.getLine(y)?.getCell(x)?.getWidth()
这个Shell配置支持即可,xtermjs前端侧不需要做什么
this.send('data', '\b\b\u001b[K');
判断是普通还是编辑修改模式
this.term.buffer.active.type === 'normal'
https://github.com/xtermjs/xterm.js/discussions/4392
function calculateCursorPosition() {
let cursorX = term.buffer.active.cursorX;
let cursorY = term.buffer.active.cursorY;
let pixelX = cursorX * 10;
let pixelY = cursorY * 20;
return {
x: pixelX,
y: pixelY
}
}
const currentLineContent = term.buffer.active.getLine(term.buffer.active.cursorY).translateToString();
程序化终端写入命令,并执行
socket发送命令到服务端即可,\r\n相当于回车。