You are not logged in.

#1 2012-12-10 19:33:45

eruditorum
Member
Registered: 2012-11-12
Posts: 130

How to make white block cursor everywhere?

Hello!
Is it possible to enable solid non-blinking white block cursor everywhere in [Arch]linux console (I mean not only shell-prompt) like it is in X-terminals, Mac OS X and default FreeBSD?
If it is possible, then how can I do this?

Thanks!

Offline

#2 2012-12-11 09:52:36

Lord Bo
Member
Registered: 2012-11-11
Posts: 168

Re: How to make white block cursor everywhere?

Read something about .Xresources in the Arch Wiki. I think the entry you are searching for is *cursorColor:white.

Edit: Wrote black at the first time...

Edit: Yes, right, as this old man from below wink implicitly annotated: This works only for X.

Last edited by Lord Bo (2012-12-11 13:22:49)

Offline

#3 2012-12-11 11:20:42

thisoldman
Member
From: Pittsburgh
Registered: 2009-04-25
Posts: 1,172

Re: How to make white block cursor everywhere?

For the linux console only, not with X:

$ echo $TERM
linux
$ echo -e '\033[?112c'        ## Unblinking white block cursor, shows char beneath
$ echo -e '\033[?48c'         ## Unblinking white block cursor, char beneath not visible

To prevent vim and other programs from resetting the cursor in the bash shell, add this to your .bashrc:

PROMPT_COMMAND='echo -e "\e[?112c"'

I don't know the equivalent of the $PROMPT_COMMAND for zsh or other shells.

See http://linuxgazette.net/137/anonymous.html.  If linux-docs is installed, you can also read /usr/src/linux-3.6.9-1-ARCH/Documentation/VGA-softcursor.txt, but the text is terse and difficult.

Offline

#4 2012-12-11 17:17:07

eruditorum
Member
Registered: 2012-11-12
Posts: 130

Re: How to make white block cursor everywhere?

Lord Bo wrote:

Read something about .Xresources in the Arch Wiki. I think the entry you are searching for is *cursorColor:white.

No, you didn't understand me. I really LIKE default static white block cursor in X-terminals, but I want exactly same cursor behaviour in Linux text-mode console (everywhere starting from kernel loading console and VT login boxes to any shell prompts and text-mode applications).
I don't need separate configuration for this type of cursor in every part of the text-mode system as it is much pain, but instead ask for one unified way to enable it everywhere in just one action.

thisoldman. yes I know that, but unfortunately this is ONLY for the shell prompt that supports it, but not for the whole text-mode system.

Thanks.

Last edited by eruditorum (2012-12-11 17:20:26)

Offline

#5 2012-12-11 21:20:06

Lord Bo
Member
Registered: 2012-11-11
Posts: 168

Re: How to make white block cursor everywhere?

Maybe that is possible with terminfo commands. I suppose that this is shell independent, but I never used it. Try for example "tput cvvis" to get a block cursor. I don't know, how to set the color and I don't know, if every terminal supports every terminfo capability. Maybe man tput can help. Or this here: http://www.comptechdoc.org/os/linux/how … mands.html

Edit: Text mode applications can set your cursor to use some other shape. For example with curses. So you do not have full control here.

Last edited by Lord Bo (2012-12-11 21:34:18)

Offline

#6 2013-03-30 09:43:50

eruditorum
Member
Registered: 2012-11-12
Posts: 130

Re: How to make white block cursor everywhere?

Finally, I've managed to get a cursor in console looking exactly the same as in X-terminals (white block with black background) writing cursor escape-code to /etc/issue file and PROMPT_COMMAND bash variable.

But unfortunately, VIM resets it back to ugly grey and blinking underline cursor and I don't know what to do with it. sad(

Last edited by eruditorum (2013-04-11 01:34:34)

Offline

#7 2015-03-29 13:33:39

freanux
Member
From: Switzerland
Registered: 2015-03-29
Posts: 4

Re: How to make white block cursor everywhere?

your answer comes maybe a little bit late. but you have to patch your linux kernel and recompile it.
get the current linux source, now open the file vt.c in drivers/tty/vt.

add following code somewhere at the beginning of this file:

#define CUR_NONBLINK 16748305

it will look like this now:

#define DEFAULT_BELL_PITCH  750
#define DEFAULT_BELL_DURATION   (HZ/8)

#define CUR_NONBLINK 16748305

now find this line:

static int cur_default = CUR_DEFAULT;

change it into:

static int cur_default = CUR_NONBLINK;

that's it. recompile your kernel and you have your BSD like blocky cursor. even if you quit vi.

cheers.

Online

#8 2015-03-29 13:54:55

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: How to make white block cursor everywhere?

Or you can use e.g. kmscon.

Offline

Board footer

Powered by FluxBB