Skip to content

Optionally include cursor in get-text --ansi  #3625

Description

@copy

Is your feature request related to a problem? Please describe.

I'm working on a tool to display local terminal contents on a website (like gotty, but more secure and optionally broadcasted through a server) by polling get-text --ansi. Here's a work in progress: https://copy.sh/stream-tty/. It works extremely well. The only missing bit is the cursor.

Describe the solution you'd like

I'd like for get-text to include the cursor styling via ansi codes. I don't care if it's enabled by default or if there is a new flag, but other users of get-text might have an opinion.

Describe alternatives you've considered

I've tested an alternative approach of a get-cursor api command. The main issue is latency: Every api call through the socket takes 70ms on my machine. Thus making two api calls (get-text and get-cursor) doubles the latency. Furthermore kitty already knows how to style the cursor and knows about line wrapping.

One downside of this approach is that not all cursor styles are renderable using ansi codes (e.g. blinking or the unfocused cursor shape). That's not an issue for my use-case.

Additional context

Here's a screenshot of kitty and a browser rendering it side-by-side with only the cursor missing on the right:

Screenshot_2021-05-14_21-01-01

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions