Hide helper text box from xterm js

拥有回忆 提交于 2020-04-13 16:55:26

问题


I am using the xterm js to create a terminal application. When I add it to my Angular app, it shows the basic terminal but also a textbox with "W" on top of it.

ngOnInit() {
    let term = new Terminal();
    let fitAddon = new FitAddon();
    term.loadAddon(fitAddon);
    let element = document.getElementById('terminal');
    if (element) {
      term.open(element);
      fitAddon.fit();
      term.write('Hello from \x1B[1;3;31mvXterm\x1B[0m $ ');
      term.onKey((key) => {
        console.log(key);
        if (key.domEvent.code === 'Enter') {
          term.writeln('');
          term.write('Hello from \x1B[1;3;31xTerm\x1B[0m $ ');
        } else {
          term.write(key.key);
        }
      });
    }
  }

and terminal.component.html file:

<div class="terminal" id="terminal"></div>

When I click on the terminal, the cursor appears on the textbox and it is DOM element from the library. Does anyone know how to remove or hide it?


回答1:


It turns out the issue is from my testing environment. not the library. Closing the question



来源:https://stackoverflow.com/questions/58886813/hide-helper-text-box-from-xterm-js

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!