Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

re-create term obj ,no mouse event repsoned. Is there some re-enter limitation existed in xterm.js #5161

Open
wellcomez opened this issue Sep 19, 2024 · 1 comment

Comments

@wellcomez
Copy link

wellcomez commented Sep 19, 2024

Details

  • Browser and browser version: chrome 127.0.6533.99
  • OS version: linux
  • xterm.js version: 5.5.0

Steps to reproduce

  1. clear and close term obj
  • xterm.js and add-on
   <script src="https://cdn.jsdelivr.net/npm/@xterm/xterm@5.5.0/lib/xterm.min.js"></script>
    <link href="https://cdn.jsdelivr.net/npm/@xterm/xterm@5.5.0/css/xterm.min.css" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/axios@1.6.7/dist/axios.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/@xterm/addon-webgl@0.18.0/lib/addon-webgl.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/@xterm/addon-fit@0.10.0/lib/addon-fit.min.js"></script>
  • clean code
//clean object
        this.term.clear();
        this.term.dispose();
        this.term.reset()
//remove node
        let terminalContainer = document.getElementById('terminal');
        let parent = terminalContainer.parentElement;
        terminalContainer.remove();
        terminalContainer = document.createElement('div');
        terminalContainer.id = "terminal";
  1. Then create obj again
    let term = new Terminal({
        allowProposedApi: true,
        cursorStyle: 'bar',  
        allowTransparency: true,
        cursorBlink: false,
        cursorWidth: 4,
        rows: rows,
        cols: cols,
        vt200Mouse: true,
        x10Mouse: true,
        vt300Mouse: true,
        MouseEvent: true,
        fontSize: fontSize,
        // fontFamily: 'SymbolsNerdFontMono "Fira Code", courier-new, courier, monospace, "Powerline Extra Symbols"',
        // fontFamily: 'Hack, "Fira Code", monospace',
        // fontFamily: 'HackNerdFontMono,monospace'
        fontFamily: 'SymbolsNerdFontMono,courier-new, courier, monospace'

        // minimumContrastRatio: 1,
    });
  1. term key event still ok but mouse event not
  2. About mouse support

After I read and trace xterm.js, it will be enable after v100/drag protocol is registered .
First time create term object , register will be called but second time not.
So I wonder whether there are global variables existed which prevent call re-enter

@jerch
Copy link
Member

jerch commented Sep 19, 2024

So I wonder whether there are global variables existed which prevent call re-enter

I dont think so, if there is, than it is prolly a dangling listener, that should have been disposed.

Its not clear, what you do on initial startup, because none of the mouse tracking protocols are active on startup by default. There has to be some payload triggering a mouse tracking sequence. Otherwise mouse tracking is always off after startup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants
@wellcomez @jerch and others