# FreeBSD 12.0-RELEASE and the Red Cursor on Console



## Datapanic (Jan 14, 2019)

I don't like the red cursor on the Console Display and it's there with vt() and sc().  Nowhere in vidcontrol() can I find an option to set the color, only the shape.  I even dug deep into the source in /usr/src/sys/dev/fb/vga.c and vesa.c and couldn't find anything there.

So where is this color set?  The cursor was not colored before 12.0.

My /boot/loader.conf

```
autoboot_delay="5"
beastie_disable="YES"
kern.vty="sc"
vesa_load="YES"
boot_multicons="YES"
boot_serial="YES"
comconsole_speed="115200"
console="comconsole,vidconsole"
```

I also have

```
allscreens_flags="MODE_322"
```

In /etc/rc.conf


----------



## getopt (Jan 15, 2019)

Thank you for bringing this up here. I also wondered about that and still wondering if this comes from some warning?

I see the red color first in early booting keeping its color for ever.



I hope someone can explain this (undocumented?) behavior as this leaves room for speculations.


----------



## Ogis (Jan 15, 2019)

Very strange. It's different for me. My cursor color is white.


----------



## VladiBG (Jan 15, 2019)

yep it's because of the kern.vty="sc"

you can try
`vidcontrol -c blink`
or
`vidcontrol -c noblock`

or if you like green
`vidcontrol -c charcolors,base=2`

edit:
to reset use
`vidcontrol -c reset`

https://lists.freebsd.org/pipermail/svn-src-head/2017-August/103730.html


----------



## Datapanic (Jan 15, 2019)

Thanks for finding that, Vlad!

After some experimenting, I changed /etc/rc.conf to this:


```
allscreens_flags="-c charcolors,base=15 MODE_322"
```

The red cursor is still there during startup, but it is white at the login prompt.

Can a KERNCONF device sc option be modified for this?


----------



## SirDice (Jan 15, 2019)

I don't think it has anything to do with sc(4) or vt(4) itself. It looks like an easy/simple identification mechanism to show which of the two is being loaded/initialized.


----------



## Datapanic (Jan 17, 2019)

I'm kind of happy with setting the `allscreens_flags` in /etc/rc.conf to:


```
allscreens_flags="-c blink -c noblock -c height=2 -c charcolors,base=15 MODE_322"
```

But, on the ESXi VM, when the system boots up, as soon as `kern.vty="sc"` gets loaded from /boot/loader.conf, the console text scrolls by and randomly *changes text colors*.  As an extra bonus, I can duplicate this on bare metal machines too.  

I don't really want to change /sys/dev/syscons/syscons.c on that line with *FG_RED* to *FG_LIGHTGREY*, but might have to and then go through the time of rebuilding world.  

What really sucks is in this snip from https://lists.freebsd.org/pipermail/svn-src-head/2017-August/103730.html


```
" Advertise this by changing the defaults to mostly red.  If you don't like
  this, change them (almost) back using:
     vidcontrol -c charcolors,base=7,height=0
     vidcontrol -c mousecolors,base=0[,height=15]"
```

We Don't Need No Stinking Advertisements!


----------



## VladiBG (Jan 17, 2019)

Why you prefer sc over vt?


----------



## Lamia (Jan 17, 2019)

It's always green on my system. I reckon it was configured in tmux. I like it though. But it vanishes after a few minutes. I will try the rc.conf setting someday with the hope that it would no longer vanish.


----------



## Datapanic (Jan 17, 2019)

VladiBG said:


> Why you prefer sc over vt?



I want a VGA text console screen with lots of lines (more than 25).


----------



## VladiBG (Jan 17, 2019)

are you using UEFI?


----------



## Datapanic (Jan 17, 2019)

VladiBG said:


> are you using UEFI?



No.  These are mostly ESXi 5.5 guests and BIOS is the only option for FreeBSD.


----------



## VladiBG (Jan 17, 2019)

i access my servers over ssh only and i don't bother to change the console. The only time that i access the console is over ILO remote terminal to install the server. I think that this change in syscons.c can be expand to include all 8 colors for selection so we can choose what background color we want and not only those 3 and maybe this is some kind of bug because selecting lightgrey don't work.


```
sc->dflt_curs_attr.base = 0;
    sc->dflt_curs_attr.height = howmany(scp->font_size, 8);
    sc->dflt_curs_attr.flags = 0;
    sc->dflt_curs_attr.bg[0] = FG_RED;
    sc->dflt_curs_attr.bg[1] = FG_LIGHTGREY;
    sc->dflt_curs_attr.bg[2] = FG_BLUE;
    sc->dflt_curs_attr.mouse_ba = FG_WHITE;
    sc->dflt_curs_attr.mouse_ia = FG_RED;
    sc->curs_attr = sc->dflt_curs_attr;
    scp->base_curs_attr = scp->dflt_curs_attr = sc->curs_attr;
    scp->curs_attr = scp->base_curs_attr;
```


----------



## mountaineer_br (Feb 20, 2019)

Hello *VladiBG*.
That reference of your is great, but not all of the story which gets even more mysterious... I actually was studying how to change text cursor settings and came across a webpage from 2007 in which the author discusses cursors and colors, amongst other configs... Since back then, there is this mysterious appearance of red cursor and I thought I would link these stories together... There is plenty reason to believe that the Red Cursor is actually a Default Cursor for some hardware. Since at least 1999, there is mention of Red Cursor at the kernel VGA-softcursor.txt..





						Cursor Appearance in the Linux Console LG #137
					






					linuxgazette.net
				




PS: Also, I think I remember seeing the Red Cursor at Android OS


----------

