DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 28th March 2014
mishaparem mishaparem is offline
New User
 
Join Date: Mar 2014
Posts: 2
Default TTY background color?

Hello everyone,

I was unsatisfied with the resolution of my TTY, so I followed the instructions here: on the OpenBSD FAQ Chapter 7 Section 5 titled "How do I use a console resolution of 80x50? (some amd64, i386, Alpha)" (sorry, can't post links in the first 5 posts, let me know if you need help finding it) to get a better resolution, but now all of the ttys have this funky brown/red background color, even the ones that should not have been affected by the change.

Is it possible to change the background color of one or all ttys without installing any additional packages? Like using a config file, or environment variable? Also, I should not that I did a TTY-only installation (no x-server or other gui-ness), so the solution should be cli only.

Thanks in advance,

Misha

EDIT: Did a little digging, and it looks like wsdisplay has some color map configuration available? Still trying to figure it out though.

Last edited by mishaparem; 28th March 2014 at 08:28 PM. Reason: more information
Reply With Quote
  #2   (View Single Post)  
Old 28th March 2014
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,128
Default

wsconscfg(8) has an example how to set a vt100 terminal emulation
Code:
EXAMPLES
     Configure screen 1 (i.e., the second) for type ``80x50'' and VT100
     terminal emulation.  (Note: ``80x50'' is a screen type offered by the
     vga(4) display driver.  In this particular case, an 8x8-font must be
     loaded beforehand to make the screen useful.  See wsfontload(8).)

           # wsconscfg -t 80x50 -e vt100 1
Terminal types like vt100 are defined in /etc/termcap The codes used to define the capability of a terminal type, including setting foreground and background color are explained in terminfo(5)

So you would have to edit /etc/termcap of the terminal type used by the OpenBSD console terminal. IIRC that is vt220.

But this all seems to be very difficult. Before attempting to change the background and/or foreground color with this method, you could try to create a file with the ANSI escape sequence to set the foreground to say green and simply use /bin/cat to display the file and see whether that is sufficient to change the foreground or text color. See https://en.wikipedia.org/wiki/ANSI_escape_code for info about these codes.

Of course that would require a change to one of the ANSI terminal types mentioned in /etc/termcap
I have to file my income tax return before April 1st, so I don't have time to investigate this any further. It is a pity, checking this color thing out is more fun, than filling a tax return
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump

Last edited by J65nko; 28th March 2014 at 09:51 PM. Reason: Added need of ANSI terminal type
Reply With Quote
  #3   (View Single Post)  
Old 28th March 2014
mishaparem mishaparem is offline
New User
 
Join Date: Mar 2014
Posts: 2
Post

I was just looking at /etc/termcap, and I found some pretty interesting options.

But only
Code:
wsconscfg -t 80x50 -e vt100 1
works. None of the types described in /etc/termcap work, giving the following error:
Code:
wsconscfg: WSDISPLAYIO_ADDSCREEN: Device not configured
I suspect that wsconscfg uses a different list, because wsconscfg(8) also says
Code:
     -e emul
             Specify the terminal emulation to use for the virtual terminal.
             The set of available terminal emulations is determined at kernel
             compile time.  See wscons(4) for details.
wscons(4) lists three available types dumb, sun, vt100 where sun and vt100 are available by default unless their flags are set to turned off, and dumb should always be available.

What I found most interesting now, is that type dumb gives the same error as all the types from /etc/termcap. Unfortunately Mr. Google only has only 6 pages of results for the error, and as I'm looking through them, I can't find a solution.
Reply With Quote
  #4   (View Single Post)  
Old 28th March 2014
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,128
Default

Looking at the .profile of root you will find

Code:
$ sudo cat /root/.profile

# $OpenBSD: dot.profile,v 1.9 2010/12/13 12:54:31 millert Exp $
#
# sh/ksh initialization

PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/sbin:/usr/local/bin
export PATH
: ${HOME='/root'}
export HOME
umask 022

case "$-" in
*i*)    # interactive shell
        if [ -x /usr/bin/tset ]; then
                if [ X"$XTERM_VERSION" = X"" ]; then
                        eval `/usr/bin/tset -sQ '-munknown:?vt220' $TERM`
                else
                        eval `/usr/bin/tset -IsQ '-munknown:?vt220' $TERM`
                fi
        fi
        ;;
esac
Here tset(1) is used to set the terminal type. You could check that man page for more info
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
X window on KDE background? maxrussell FreeBSD General 14 13th October 2011 06:50 PM
More background on the US security firm break-in J65nko News 0 17th February 2011 04:43 PM
Grey checkered background before kdm jewsofeast OpenBSD General 5 10th January 2011 02:37 PM
Terminal background goes red stobbard OpenBSD General 5 11th May 2010 09:42 AM
Want to get rid of ugly color of rox rex FreeBSD General 6 12th May 2008 12:02 AM


All times are GMT. The time now is 11:26 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick