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
Space+Underline is not rendered properly #4901
Comments
@ceccopierangiolieugenio Whats the exact byte content sent for that underline line? |
@jerch |
You can get byte content on console.log, if you enable the debug log in the terminal. I am asking for the byte content, because your screenshot for xterm.js - 5.1.0, 5.2.0 indicates some issues with encoding (looks like mixing latin-1 with utf-8). Once we have ruled that out, we can check if the renderers do crazy things. |
New test where I used for testing: <div id="terminal"></div>
<script>
var term = new Terminal({
logLevel: 'debug',
allowProposedApi: true});
term.open(document.getElementById('terminal'));
term.write(' # CSI Ps m Character Attributes (SGR).\n\r')
term.write('Hello from \x1B[1;0;31mxterm.js test\x1B[0m Ps=0 -> Normal (default), VT100.\n\r')
term.write('Hello from \x1B[1;1;31mxterm.js test\x1B[0m Ps=1 -> Bold, VT100.\n\r')
term.write('Hello from \x1B[1;3;31mxterm.js test\x1B[0m Ps=3 -> Italicized, ECMA-48 2nd.\n\r')
term.write('Hello from \x1B[1;4;31mxterm.js test\x1B[0m Ps=4 -> Underlined, VT100.\n\r')
term.write('Hello from \x1B[4;2mxterm.js test\x1B[0m Ps=4 -> Underlined, VT100.\n\r')
term.write('Hello from \x1B[4;5mxterm.js test\x1B[0m Ps=4 -> Underlined, VT100.\n\r')
term.write('Hello from \x1B[1;9;31mxterm.js test\x1B[0m Ps=9 -> Crossed-out characters, ECMA-48 3rd.\n\r')
</script> Here is a comparison between the different versions, the bytes sent are identical; xterm.js 5.0.0
xterm.js 5.1.0
xterm.js 5.3.0
|
Hmm where does that dotted uppercase A come from (not even sure which unicode thingy that is)? How do you send the data to the terminal? If those numbers in the array are indeed the sent bytes to the terminal, then this weird char should not have occurred at all.
(Note that I cannot repro any of this, so there is mostly something off on your end and how you provide the data to the terminal.) |
Plz also see https://stackoverflow.com/a/1462039/12548337, might explain that Å char. Maybe you forgot to declare the html document as utf-8? |
@jerch I have verified. It's encoding issue, but why does the xterm demo work properly. 😟 |
Thanks @jerch it is exactly the issue reported in: <head>
<meta charset="utf-8">
<head> The issue was caused by the encoding of the '\xa0' in: xterm.js/src/browser/renderer/dom/DomRendererRowFactory.ts Lines 272 to 274 in 957e3e0
Unfortunately I never managed to run the demo, I amnot a js/ts expert and I don'know how to build and start it. |
The demo uses utf-8 encoding on its document. For the DOM renderer this is indeed crucial, as we forward any unicode chars directly to the DOM. With non unicode-capable encoding the DOM then would make something else out of those chars. |
@Tyriar The need for an utf-8 encoded document for the DOM renderer feels like a surprising limitation (in fact it isnt when thinking about it for a few seconds, also it is recommended as default with html5). Should we mention that in some sort of a document setup guide? |
Details
Steps to reproduce
follow the installation steps on the homepage: https://xtermjs.org
Use this html testing file:
Issue:
as shown here:
The fifth line should render three underlined spaces but those are not vivible
This issue is noticeable also if I use pyTermTk, where only the different chars of the buffer are sent to the terminal but the entire line is affected:
Regression
No issues:
Some artifacts are displayed:
Underlined Spaces are not rendered:
The text was updated successfully, but these errors were encountered: