Skip to content

xterm-addon-fit Shrinking the screen doesn't work #3564

@xiaolannuoyi

Description

@xiaolannuoyi

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

  1. 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)
    },

aaa

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions