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

fix cursor shaping in Linux kernel console (and probably iTerm2) #2572

Merged
merged 2 commits into from
Dec 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 31 additions & 5 deletions WinPort/src/Backend/TTY/TTYOutput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -393,14 +393,40 @@ void TTYOutput::ChangeCursorHeight(unsigned int height)
stk_ser.PushNum((uint8_t)0); // zero ID means not expecting reply
SendFar2lInteract(stk_ser);

} else if (_kernel_tty) {
; // avoid printing 'q' on screen

} else if (height < 30) {
Format(ESC "[3 q"); // Blink Underline

if (_kernel_tty) {

// Available sizes are from 2 to 8
Format(ESC "[?2c");

/**

Same for FreeBSD:

https://man.freebsd.org/cgi/man.cgi?query=screen
E[=s;eC Set custom cursor shape, where
s is the starting and e is the ending
scanlines of the cursor

**/

} else {
Format(ESC "[3 q"); // Blink Underline
Format(ESC "]50;CursorShape=2\x07"); // Same for iTerm2
}

} else {
Format(ESC "[0 q"); // Blink Block (Default)

if (_kernel_tty) {

// Available sizes are from 2 to 8
Format(ESC "[?6c");

} else {
Format(ESC "[0 q"); // Blink Block (Default)
Format(ESC "]50;CursorShape=0\x07"); // Same for iTerm2
}
}
}

Expand Down