chjj / term.js

A terminal written in javascript.
MIT License
1.55k stars 337 forks source link

Height of terminal changes with split tmux panes #11

Open alanchrt opened 10 years ago

alanchrt commented 10 years ago

I've noticed similar behavior in tty.js

Switching between two tmux windows is fine, and the size of the terminal remains consistent:

image

image

However, when I split tmux vertically, the terminal height increases:

image

It looks like it's one pixel per row. In this instance of 40 rows, it jumped from 600px to 639px in height. It's more pronounced with more rows.

My only guess is that it has something to do with the height of the pipe character – | – being used to split the panes, but I don't know why this doesn't cause issues in split Vim as well.

Any ideas?

alanchrt commented 10 years ago

Ah, apparently those two characters are slightly different:

>>> ord('|')
124
>>> ord('│')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: ord() expected a character, but string of length 3 found

Still not sure how to resolve it.

alanchrt commented 10 years ago

This is the offending character: http://www.fileformat.info/info/unicode/char/2502/index.htm

alanchrt commented 10 years ago

Looks like it depends on the font. Andale Mono does a decent job with it, but has other spacing issues. Any recommended font?

amshali commented 9 years ago

I hit this issue as well in a different context. Any good recommended font?

yoshiokatsuneo commented 9 years ago

I made a Pull Request that handles non-English characters. https://github.com/chjj/term.js/pull/97