terminal-kit: "resize" event not working?
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?
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 18 (15 by maintainers)
Commits related to this issue
- Try to fix terminal resizing detection on windows (#54) — committed to cronvel/terminal-kit by cronvel 7 years ago
@laurent22 @refack Thanks a lot, it will be really useful. I don’t have Windows anymore and I never used it for dev, so I terribly lack experience. And there are many specific environments like Cygwin and WSL, or various terminals more or less compliant (putty, console2, etc). I realize that there are more Node.js developers working on this platform than I could imagine, and I would be happy if they could fully enjoy the lib 😉