# Green on black text



## balanga (Dec 4, 2017)

I was trying to find out how to setup green on black text and most references related to `videocontrol`, the only thing I could find realting to sc(4)() was this:-



> The following lines will set the default colors.  The normal text will be
> green on black background.     The reversed text will    be yellow on green
> background.  Note that you    cannot put any white space inside the quoted
> string, because of    the current implementation of config(8).
> ...



Do I need to implement this by changes to /boot/device.hints? The instructions don't make it clear as to what to do.


----------



## ShelLuser (Dec 4, 2017)

Well, current FreeBSD versions use vt(4) instead of sc(4) by default, so I'd look there. I spot the same kind of example in its manualpage, but still slightly different:


```
This example changes the default color of normal text to green on a black
     background, or black on a green background when reversed.  Note that
     white space cannot be used inside the attribute string because of the
     current implementation of config(8).

           options TERMINAL_NORM_ATTR=(FG_GREEN|BG_BLACK)
```
To my knowledge this option should be set in /boot/loader.conf after which you should be all set.


----------



## tobik@ (Dec 4, 2017)

These are kernel compile time options. You set them in your kernel config file. Setting them will require a kernel rebuild.


----------



## ShelLuser (Dec 4, 2017)

meh, I obviously need more coffee.

Still, now I am intrigued to discover that this is a compiled option vs. a dynamic changeable option. It seems doable enough to change the text color dynamically. I suppose color codes within a shell prompt could also do the trick, but that's just not the same I guess, time for some experimentation


----------



## Snurg (Dec 4, 2017)

ShelLuser said:


> Still, now I am intrigued to discover that this is a compiled option vs. a dynamic changeable option. It seems doable enough to change the text color dynamically. I suppose color codes within a shell prompt could also do the trick, but that's just not the same I guess, time for some experimentation


Very good suggestion, I would fully support that.

Reason:
Aside of the fact that the need to make a custom kernel requires much effort and knowledge on the (possibly new) user's side, that leads to the fact that the resulting system is no longer GENERIC.
And that in turn causes the problem for all people trying to do support, they cannot be really sure whether that user's config is actually GENERIC. Remember, people happen to make mistakes when editing kernel configuration files.

And changing from the default (extremely unergonomic) white on black should be easier than now. Inverse display like that was ok 40 years ago, but not today.

As a heavy console user I need normal display, not inverted, as that fatigues me much. So I several times got the message "sorry you have a custom kernel, we cannot help" just because of the fact I had to make kernel to get a console that is no pain to use.
Even Linux has the option to set console parameters on-the-fly without rebuilding kernel. I think FreeBSD should be able to do the same.

OT: And there is another point regarding the default vt console, why I find it unusable. Its scrollback buffer (access it using ScrollLock key) is way too small. vt does not offer an option to set another size, like sc does with the "options SC_HISTORY_SIZE=...". This single point is why I will not use vt until it offers a similiar option.


----------



## balanga (Dec 4, 2017)

I iassumed that my question would be easily resolved, and after further searches I'm none the wiser...


----------



## mrclksr (Dec 4, 2017)

```
# vidcontrol green
```
Add

```
allscreens_flags="green"
```
 to /etc/rc.conf if you want all your virtual consoles to have green text color.


----------



## balanga (Dec 5, 2017)

mrclksr said:


> ```
> # vidcontrol green
> ```
> Add
> ...



I didn't think that 
	
	



```
allscreens_flags=
```
 worked with sc(4)()... but your solution does work.... although I would like to get the same effect in X terminals?


----------



## Phishfry (Dec 5, 2017)

On x11/xfce4-terminal it is under Preferences:


----------



## k.jacker (Dec 5, 2017)

`xterm -bg black -fg green`


----------



## mrclksr (Dec 5, 2017)

balanga said:


> I didn't think that
> 
> 
> 
> ...





			
				vidcontrol(1) said:
			
		

> The *vidcontrol* utility is used to set various options for the syscons(4)
> or    vt(4) console driver, such as video mode, colors, cursor shape,    screen
> output map, font and screen saver timeout.     Only a    small subset of
> options is    supported by vt(4).



In /etc/rc.d/syscons:

```
for ttyv in /dev/ttyv*; do
           vidcontrol ${allscreens_flags} < ${ttyv} > ${ttyv} 2>&1
       done
```


----------



## SirDice (Dec 6, 2017)

balanga said:


> although I would like to get the same effect in X terminals


That's what ~/.Xdefaults is for. 

https://wiki.archlinux.org/index.php/x_resources#Xresources_syntax
https://engineering.purdue.edu/ECN/Support/KB/Docs/UsingTheXdefaultsFil


----------

