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

Disable visible cursor #45

Open
randohinn opened this issue Dec 28, 2021 · 1 comment
Open

Disable visible cursor #45

randohinn opened this issue Dec 28, 2021 · 1 comment

Comments

@randohinn
Copy link

What changes to the source would be required to enable the complete hiding of the cursor?

@Jeija
Copy link
Collaborator

Jeija commented Dec 28, 2021

Internally, GTKTerm uses VTE as a terminal emulator widget. So everything related to the visual appearance of the terminal has to be configured through the VTE APIs.

As far as I know, VTE supports different cursor shapes (block, underline, vertical beam) and allows enabling / disabling cursor blinking, but does not allow hiding the cursor completely. If this is true (and I'd be glad to be disproven), the cursor cannot be hidden using the official VTE API.

However, there is a much easier way to hide the cursor:
There is an ANSI escape sequence that hides and unhides the cursor that GTKTerm respects. So, if you have control over the device you are communicating with, you can just send this control sequence from the device. For example, if you have printf on the device (e.g., microcontroller), this is how you would hide the cursor:

printf("\033[?25l");

And this is how you would un-hide it:

printf("\033[?25h");

In theory, it would be possible to manually "send" these escape sequences to VTE internally within GTKTerm to add a hide/unhide cursor menu item, but I would prefer not to go there if not strictly necessary...

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

3 participants