"resize" event not working?
See original GitHub issueI’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?
Issue Analytics
- State:
- Created 6 years ago
- Comments:18 (15 by maintainers)
Top Results From Across the Web
javascript - resize event not triggered on div
I've attached an "resize" event listener on container div. After opening up dev tools, and modifying the width of container , resize callback ......
Read more >Window: resize event - Web APIs | MDN
The resize event fires when the document view (window) has been resized. This event is not cancelable and does not bubble.
Read more >How to Capture Browser Window Resize Event in JavaScript
Answer: Use the addEventListener() Method You can simply use the addEventListener() method to register an event handler to listen for the browser window...
Read more >How to wait resize end event and then perform an action ...
We want the “resize” event to only be fired once we are done resizing. Prerequisite: To solve this problem we use two functions:....
Read more >onresize Event
Example. Execute a JavaScript when the browser window is resized: <body onresize="myFunction()">.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@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 😉
If you need Windows specific review, feel free to ping me as well.