-
Notifications
You must be signed in to change notification settings - Fork 203
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
"resize" event not working? #54
Comments
@laurent22 Can you test it with those events:
Terminal-kit use Node for that, and I don't know if Windows reports terminal resizing at all. Please, can you check the |
Apparently, this is a known issues in the node.js repository . |
Seems that's the key. If I add an event listener for this, then the rest of it suddenly works. i.e. this doesn't work:
However if I add this at the bottom:
Then this event handler and the two previous ones also start working, so it seems adding this triggers something that makes terminal-kit (and node) detect resize events correctly.
Maybe the solution would be to enable the |
@laurent22 Wow, what an incredibly awkward behavior... -_-' |
Yes that was inside WSL, from ConEmu (in tmux if it makes a difference). |
@laurent22 Does this fix this issue? |
Unfortunately it still shows the same problem. I've tried running the file all-event-test.js and it didn't detect the resize event. However again if I add this line at the bottom: |
@laurent22 Argh... what is the value of |
Oh right I see you have a check on process.platform, but on Windows WSL it actually returns "linux". If needed there's a package here that can detect WSL: https://github.com/ianmitchell/is-windows-bash |
Can anyone check if this reproduces with |
@refack, yes it's still happening in node 8.7.0. This doesn't work; setInterval(function() {}, 1000);
process.stdout.on('resize', function() {
// Never fires
console.info('Resize (process.stdout)');
}); But with the empty setInterval(function() {}, 1000);
process.stdout.on('resize', function() {
console.info('Resize (process.stdout)'); // It works
});
process.on('SIGWINCH', function() {}); |
@laurent22 thanks! |
Brilliant, thanks for the update! |
Great! |
I can help with that if needed. I'm using Terminal Kit quite a lot in a note-taking app I'm working on at the moment (it's here but not officially released yet) and I'm only using Windows. For the most part I didn't have any issue actually other than the |
If you need Windows specific review, feel free to ping me as well. |
@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'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:
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?
The text was updated successfully, but these errors were encountered: