new Terminal() and term.open(document.getElementById('terminal-container'));
Looks like not load xterm css file ? I use xterm with react.
Hi zhangjie2012,
I don't know that much about react but when you require('xterm') or import 'xterm' you only get js unless your using some special loader. Webpack has a special loader to handle style/css but you have to point to xterm's css file using the import statement. Refer to your bundler/loader's documentation for loading css.
To be clear. The css and js files are stored separately and usually need multiple import statements to get them both.
Yes you'll need to include the CSS file as well as in the getting started snippet https://github.com/xtermjs/xterm.js#getting-started
for scss:
@import '~xterm/dist/xterm.css';
Most helpful comment
Hi zhangjie2012,
I don't know that much about react but when you
require('xterm')orimport 'xterm'you only get js unless your using some special loader. Webpack has a special loader to handle style/css but you have to point to xterm's css file using the import statement. Refer to your bundler/loader's documentation for loading css.To be clear. The css and js files are stored separately and usually need multiple import statements to get them both.