Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vim cursors shapes? #356

Closed
097115 opened this issue Jul 11, 2020 · 10 comments
Closed

Vim cursors shapes? #356

097115 opened this issue Jul 11, 2020 · 10 comments

Comments

@097115
Copy link

097115 commented Jul 11, 2020

Does tcell support setting Vim cursors' shapes?

@gdamore
Copy link
Owner

gdamore commented Jul 11, 2020

I think you mean something other than "Vim" (unless Vim is your terminal?)

We don't support changing cursor shapes at any rate, because I have no idea about what the escape codes for doing that are.

@097115
Copy link
Author

097115 commented Jul 11, 2020

unless Vim is your terminal?

Well, it's actually aerc mail client, which is my terminal in this particular case :). And which seems to use tcell for that. (I mentioned "Vim" above because I learned about those from Vim, and it only matters for me in Vim, to distinguish modes :). Sorry for the confusion.)

what the escape codes for doing that are

Something like this?

Like, printf '\033[6 q' should change the cursor to a vertical line, for example.

@adigitoleo
Copy link

Just encountered this as well, also in aerc. In my zshrc I use:

echo -ne "\e[2 q"
echo -ne "\e[5 q"

They are for block and beam cursor shapes respectively. Not sure what the best options are for portability to be honest, but it could be nice to have the option. Cursor shape basically replaces vim's showmode for me :)

@callum-oakley
Copy link

Agreed it would be nice to have an interface for this in tcell, but fwiw in the meantime you can always just send the relevant escape sequence to stdout yourself:

func setCursorShape(n int) {
	// https://invisible-island.net/xterm/ctlseqs/ctlseqs.html
	// 1 blinking block (default)
	// 3 blinking underline
	fmt.Printf("\033[%d q", n)
}

@097115
Copy link
Author

097115 commented Jun 5, 2021

Well, that's nice for developers, of course, but I'm talking from the end user's point of view.

@gdamore
Copy link
Owner

gdamore commented Jun 5, 2021 via email

@gdamore
Copy link
Owner

gdamore commented Jun 5, 2021 via email

@097115
Copy link
Author

097115 commented Jun 5, 2021

Tcell is a developers product lol.

Try to think more and lol less, may be then you'll get that not every tcell user is using it as a developer.

@gdamore
Copy link
Owner

gdamore commented Jun 6, 2021

The only way to use tcell directly is as a developer. If I add an API for cursor shapes your app won't benefit from it unless they also add code (developer) to do so.

You profane commentary you can keep to yourself.

@gdamore
Copy link
Owner

gdamore commented Jun 6, 2021

While here, if you are gonna behave that way to a developer who builds something that you use but which provide no contribution to, maybe you should stop using my work. And anything else that is built upon my work.

I'm not looking for any contribution from you here, but ad hominem attacks laced with profanity are most definitely unwelcome here. Whether towards me or towards anyone else.

Please see the code of conduct for this project for more detail.

gdamore added a commit that referenced this issue Sep 26, 2021
This adds a new method, SetCursorStyle() to the screen API.
It also automatically restores the cursor when disengaging to
the default cursor.  Modern terminals (and Windows console) support
this.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants