Add index.js used to test xterm-core
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import { createRequire } from 'module';
|
||||
const require = createRequire(import.meta.url);
|
||||
const xterm = require('xterm-core');
|
||||
|
||||
console.log('Creating xterm-core terminal...');
|
||||
const terminal = new xterm.Terminal();
|
||||
console.log('Writing `ls` to terminal...')
|
||||
terminal.write('ls', () => {
|
||||
const bufferLine = terminal.buffer.normal.getLine(terminal.buffer.normal.cursorY);
|
||||
const contents = bufferLine.translateToString();
|
||||
console.log(`Contents of terminal active buffer are: ${contents}`); // ls
|
||||
});
|
||||
Reference in New Issue
Block a user