terminal-kit: .getCursorLocation() timed out

Executing term.inputField results in the following error:

    at Promise.resolveSafeTimeout.then (webpack:///./node_modules/terminal-kit/lib/Terminal.js?:1522:16)
    at Promise._execOneFulfillHandler (webpack:///./node_modules/seventh/lib/core.js?:163:19)
    at Promise._execFulfillHandlers (webpack:///./node_modules/seventh/lib/core.js?:152:9)
    at Promise._resolveValue (webpack:///./node_modules/seventh/lib/core.js?:108:8)
    at Promise.resolve (webpack:///./node_modules/seventh/lib/core.js?:101:14)
    at fn.result_ (webpack:///./node_modules/seventh/lib/core.js?:77:9)
    at Timeout.setTimeout [as _onTimeout] (webpack:///./node_modules/seventh/lib/misc.js?:90:23)
    at ontimeout (timers.js:386:14)
    at tryOnTimeout (timers.js:250:5)
    at Timer.listOnTimeout (timers.js:214:5) code: 'timeout' }```

Here is my code:

term.inputField(function (error: any, userInput: string) { if (error) { console.log('[Input] error -> ', error); } else { console.log(userInput) } });


I'm using Mac OS 10.14 Mojave and Nodejs v7.8.0

About this issue

  • Original URL
  • State: open
  • Created 6 years ago
  • Reactions: 3
  • Comments: 17 (8 by maintainers)

Commits related to this issue

Most upvoted comments

@afturner Thanks for reporting. However, you may want want to use Terminal-kit for input handling, something like this:

var term = require( '../lib/termkit.js' ).terminal ;
term.grabInput() ;
term.on( 'key' , name => {
    if ( name === 'CTRL_C' ) {
        safeExit() ;
    }
    // ...
} ) ;

It’s best not to interfere with process.stdin / process.stdout when using Terminal-kit (since the lib does things with those objects too).