F 修复web终端显示区域未自适应的问题

pull/586/head
vapao 2022-07-14 14:43:13 +08:00
parent 45dc60598e
commit e8baf235f5
1 changed files with 1 additions and 2 deletions

View File

@ -39,7 +39,7 @@ function WebSSH(props) {
socket.onopen = () => { socket.onopen = () => {
term.write('ok') term.write('ok')
term.focus(); term.focus();
fitPlugin.fit(); fitTerminal();
}; };
socket.onclose = e => { socket.onclose = e => {
setTimeout(() => term.write('\r\n\r\n\x1b[31mConnection is closed.\x1b[0m\r\n'), 200) setTimeout(() => term.write('\r\n\r\n\x1b[31mConnection is closed.\x1b[0m\r\n'), 200)
@ -63,7 +63,6 @@ function WebSSH(props) {
term.setOption('fontSize', gStore.terminal.fontSize) term.setOption('fontSize', gStore.terminal.fontSize)
term.setOption('fontFamily', gStore.terminal.fontFamily) term.setOption('fontFamily', gStore.terminal.fontFamily)
term.setOption('theme', gStore.terminal.styles) term.setOption('theme', gStore.terminal.styles)
fitTerminal()
// eslint-disable-next-line react-hooks/exhaustive-deps // eslint-disable-next-line react-hooks/exhaustive-deps
}, [gStore.terminal]) }, [gStore.terminal])