Skip to content

"resize" event not working? #54

Closed
Closed
@laurent22

Description

@laurent22

I'm trying to get the resize event to work, or simply to get the new terminal height whenever it's resized, but it's not working so far.

I've narrowed it down to this simple script:

var term = require( 'terminal-kit' ).terminal ;

setInterval(function() {
	console.info(term.height);
}, 1000);

term.on('resize', function(width, height) {
	console.info('Resize: ' + width + ', ' + height);
});

This will continuously print the same size, even as I resize the terminal, and the "resize" event is never fired.

If I Ctrl+C the script and start it again, it will then pick up the new terminal size, so it's getting it right but it just never updates once the script starts.

I've tried in ConEmu and the default Windows terminal, both under WSL and DOS but none of these are working. Any idea what could be the issue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions