You are not logged in.
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
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 implicitly annotated: This works only for X.
Last edited by Lord Bo (2012-12-11 13:22:49)
Offline
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
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
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
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. (
Last edited by eruditorum (2013-04-11 01:34:34)
Offline
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.
Offline
Or you can use e.g. kmscon.
Offline