refactor: 终端记录调整

This commit is contained in:
meilin.huang
2023-12-06 13:17:50 +08:00
parent 9de8dae954
commit 790d644c34
7 changed files with 63 additions and 126 deletions

View File

@@ -144,8 +144,6 @@ const onConnected = () => {
state.status = TerminalStatus.Connected;
// resize
sendResize(term.cols, term.rows);
// 注册窗口大小监听器
window.addEventListener('resize', debounce(fitTerminal, 400));
@@ -180,7 +178,8 @@ const clear = () => {
function initSocket() {
if (props.socketUrl) {
socket = new WebSocket(props.socketUrl);
let socketUrl = `${props.socketUrl}&rows=${term.rows}&cols=${term.cols}`;
socket = new WebSocket(socketUrl);
}
// 监听socket连接