question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

.getCursorLocation() timed out

See original GitHub issue

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

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
cronvelcommented, Nov 2, 2018

@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).

0reactions
cronvelcommented, Jun 18, 2020

@mkey It has always been possible to specify the x,y coordinate of an inputField, however I just discovered that this feature was not documented, it’s fixed now (doc).

Also now, as of v1.35.5, .inputField(), .progressBar() and all .*Menu() widget fallback to the last line position when requesting cursor location is not possible on the terminal (mainly a Windows problem).

Read more comments on GitHub >

github_iconTop Results From Across the Web

get position of mouse inside interval to move a div with mouse
I'm trying to move a div with the movement of the mouse cursor, but can't understand how to get the newly updated mouse...
Read more >
cursor timeout vs mongo connecttimeout - Google Groups
The two timeouts are for very different things. The cursor timeout refers to the amount of time the server will keep the cursor...
Read more >
How do I continuously read the mouse position ... - MathWorks
get (0, 'PointerLocation') Try this by moving your mouse around and invoking this command each time. You will see that the output keeps...
Read more >
Iterate a Cursor in mongosh — MongoDB Manual
The db.collection.find() method returns a cursor. To access the documents, you need to iterate the cursor. However, in mongosh , if the returned...
Read more >
Get Mouse Position in JavaScript ('x' and 'y') - YouTube
Source code on CodePen:https://codepen.io/dcode-software/pen/exbKLvThrough using the MouseEvent object, you are able to access the 'x' and ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found