cronvel / terminal-kit

Terminal utilities for node.js
MIT License
3.08k stars 198 forks source link

terminal.createDocument doesn't pass an eventSource #202

Closed alexrhogue closed 2 years ago

alexrhogue commented 2 years ago

The documentation (and code) in the terminal function createDocument say it will pass a valid eventSource into the Document constructor if one is not provided. However, I get the following errors when calling createDocument

TypeError: this.eventSource.grabInput is not a function
    at new Document (/sandbox/node_modules/terminal-kit/lib/document/Document.js:104:20)

Here's a codesandbox that demonstrates the issue: https://codesandbox.io/s/optimistic-snyder-qlqmxq?file=/src/index.js

noteI I cloned this repo and ran the sample: node ./sample/document/document-test.js and it worked as expected.

OSX 12.2.1 Node v17.4.0

alexrhogue commented 2 years ago

Haha. I see. I was calling new first: new term.createDocument().