Skip to content

missing x,y for current cursor position on process.stdout #49

Description

@coolaj86

I'm a very experienced node.js developer, but not very experienced ANSI terminal developer.

How do I determine the current location of the cursor?

I see that I can determine the window size with process.stdout.columns, process.stdout.rows, and there's a nifty resize event. Awesome.

But there isn't a process.stdout.column and process.stdout.row or process.stdeout.x, process.stdeout.y to tell me where I currently am, which kind of stinks.

Is there a technical reason as to why this isn't available? Or is it just not documented? Or does it need some love and a pull request?

Practical Use Case

I've got a websocket checking on some stuff in the background. Every few seconds it updates a status message in known location the upper right corner. The function should check to see where the cursor is, make the update, and put the cursor back where it was.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions