Details
- Browser and browser version: chrome/版本 96.0.4664.55(正式版本) (arm64)
- OS version: macos 12.0.1 (21A559)
- xterm.js version: 4.0.5
- xterm-addon-fit: 0.5.0
Steps to reproduce
- xterm-addon-fit 扩大屏幕时好使,缩小屏幕时不好使
initTerm() {
const term = new Terminal(this.option)
this.fitAddon = new FitAddon()
term.loadAddon(this.fitAddon)
term.open(this.$refs.terminal)
term.write(this.initText)
this.fitAddon.fit()
return term
},
onResize: debounce(function () {
console.warn('resize')
this.fitAddon.fit()
}, 0),
onTerminalResize() {
window.addEventListener('resize', this.onResize)
this.term.onResize(this.resizeRemoteTerminal)
},
removeResizeListener() {
window.removeEventListener('resize', this.onResize)
},
I got the same problem. But i found this way, it’s work for me :