jonschlinkert/window-size

`height` and `width` mixed up

sompylasar opened this issue · 7 comments

https://nodejs.org/api/tty.html#tty_ws_columns
https://github.com/jonschlinkert/window-size/blob/master/index.js#L24-L25

    } else if (process.stdout.columns && process.stdout.rows) {
      height = process.stdout.columns;
      width = process.stdout.rows;
    }

width should be assigned from columns, height should be assigned from rows.

fixed in 0.2.0, fwiw I would have published a patch, but given how much this is downloaded it's highly possible if not likely that this change would break someone's code.

thanks for the issue

thanks! actually, your code inspired this code which has got the bug copied: AriaMinaei/RenderKid#5 -- and RenderKid is used as a dependency for the library called pretty-error which cleans and beautifies error stack traces for the console.

you sure about that? If it was I guess that's too bad lol, I don't see any acknowledgements or references to this lib, which is now fixed and would have fixed that lib too with a patch bump ;)

There is a comment at the top of the function:

  getCols: ->
    # Based on https://github.com/jonschlinkert/window-size

And that's lol too bad, of course. 💯

damn! lol nice catch though. I was of course saying that tongue-in-cheek, but it would have been nice to not be "officially" responsible for breaking their code lol

@jonschlinkert if they had your library as a dependency, you would be responsible, but currently this is not the case -- they should have read what they copy-paste.

I was jk, lol. no worries though, thanks!