term.js
term.js copied to clipboard
Rendering of certain whole-screen applications (like mc) is broken.
Context
This originated as ipython/ipython#7782 on IPython, but it seems that it's better reported directly here. IPython uses term.js purely as a component, wrapped in terminado, a Tornado-based async server. It then exposes the terminals in the IPython Notebook application.
The issue
On Chrome on Linux, if I set the Consolas font to being my monospaced font, when running mc (Midnight Commander) in the terminal, the computation of the column width must be wrong, b/c the page misrenders:
This is even more evident when an error box is drawn:
Checking the value of Terminal.brokenBold
in the JS Console returns true
with Consolas. Yet, the fix in ipython/ipython#7242 isn't helping here.
For reference, switching to another monospaced font, such as DejaVu Sans Mono, fixes the problem. So at least there's a workaround.
But even if the bug is in Consolas, it would be nice if we could make it work correctly (if viable). Regular terminal emulators don't exhibit this behavior. As noted by @takluyver in ipython/ipython#7242, this may not be easily fixable without way too much work. If that's the case, so be it, at least this will document the problem for future users.
ps - for extra details on this issue from the IPython side, see ipython/ipython#7242.
Are you certain that is a monospace font?
brokenBold
is there to check whether the browser makes monospace characters "bigger" when boldened, i.e. they push other elements aside more. Obviously for a terminal to work, characters need to be aligned properly. I don't think that's what is happening here though if brokenBold is true (and I don't see any bold text there).
Consolas is one of Microsoft's monospaced fonts.
Here are examples of the same screenshots above, using Consolas, on a regular terminal emulator:
and the error box:
Now, I'm not saying it's not a buggy monospaced font :) But I've used it for many years successfully in my terminal emulators and in Emacs, without this problem. Hope this helps...