xtermjs / xterm.js

A terminal for the web
https://xtermjs.org/
MIT License
17.33k stars 1.61k forks source link

Only first character is invisible when rendering invisible text via escape code #4962

Closed sebnozzi closed 6 months ago

sebnozzi commented 6 months ago

Rendering "invisible" text via escape-codes only makes the first character in the sequence invisible. The rest remain visible.

Details

Steps to reproduce

  1. Create a Terminal object
  2. Write(ln) the string Test: \x1B[8mINVISIBLE\x1B[m vs. VISIBLE
  3. Expected: to see "Test: vs. VISIBLE"
  4. Actual: "Test: NVISIBLE vs. VISIBLE" (note the invisible "I")

To reproduce I offer this HTML file:

<!doctype html>
<html>
<head>
  <link rel="shortcut icon" href="#">
  <title>xterm.js - Invisible Text Bug</title>  
  <link rel="stylesheet" href="node_modules/xterm/css/xterm.css" />
  <script src="node_modules/xterm/lib/xterm.js"></script>
</head>
<body>
  <div id="terminal"></div>
  <script>
    const term = new Terminal();
    term.open(document.getElementById('terminal'));
    term.writeln('Test: \x1B[8mINVISIBLE\x1B[m vs. VISIBLE');
  </script>
</body>
</html>
jerch commented 6 months ago

Cannot repo in master - could you check with the newer package @xterm/xterm?

sebnozzi commented 6 months ago

Cannot repo in master - could you check with the newer package @xterm/xterm?

Thanks for the quick reply.

Checked with @xterm/xterm. Indeed my issue seems to be fixed in that version.

Will this be the next version? Almost all the documentation suggests to install xterm, not @xterm/xterm.

jerch commented 6 months ago

Yes that will be the new official package names for v5.4+. We had to change to prefixed package names due a malicious package name scam.

sebnozzi commented 6 months ago

Ok, seeing this will be fixed in a future version, and assuming the documentation will be updated, I will close this issue then.