Hurrah! I've found the answer. My scrotwm open up xterm with tmux instead of plain xterm. Just now I used:
program[term] = xterm -e tmux
To open new term with tmux. That's what causing the 256 color issue. Seems like opening tmux like that made the xterm not setting the correct $TERM. That's why if I open an xterm, then open tmux, the 256 color will look as it's intended. So I changed that to xterm -tn xterm-256color -e tmux so that the xterm will open with 256 color $TERM correctly. And it works! Here's my ~/.scrotwm.conf for your pleasure. Feel free to use it.
Do note that I don't use spawn_term = xterm anymore. Initially I changed that to open tmux automatically, but defining other than "xterm" value just don't work. Hitting MOD+Return just didn't open any xterm at all. So that's why I had to use program[xterm] instead. As long as it works.
And here's my whole ~/.profile. Do take note on the upper part of the file especially on the xterm & tmux bit.
As usual, use it if you want to. Later.
Showing posts with label xterm-256color. Show all posts
Showing posts with label xterm-256color. Show all posts
Thursday, August 25, 2011
OpenBSD NC4200: tmux + vim + xterm 256 color.
Sorry I have to delete my previous post. Surely that was a bit hurried. I should've tested more on the 256 color issue with tmux + vim. Ok, first of all, let's rewind back a bit for the history.
This is the scenario.
My vim's 256 color theme just got the wrong color in tmux than in regular xterm. I have set up MOD+Return in scrotwm to open up tmux inside xterm. When I use that, there's color but my wombat256 theme for vim is very different. If I open xterm, then open tmux, the theme will look as it should be. So I know this have something to do with $TERM env, and I'm searching the man for answer. I will post my ~/.profile with relevant files after I can make vim 256 color work correctly. Later then.
This is the scenario.
My vim's 256 color theme just got the wrong color in tmux than in regular xterm. I have set up MOD+Return in scrotwm to open up tmux inside xterm. When I use that, there's color but my wombat256 theme for vim is very different. If I open xterm, then open tmux, the theme will look as it should be. So I know this have something to do with $TERM env, and I'm searching the man for answer. I will post my ~/.profile with relevant files after I can make vim 256 color work correctly. Later then.
Tuesday, March 08, 2011
OpenBSD NC4200: My .profile for TERM type. xterm-256color / wsvt25.
OpenBSD have 256 color support in xterm, which is xterm-256color. For console, setting the TERM to wsvt25 is better. Color will work but weird stuff will happen is you use xterm term type for console, such as funny scrolling while ls-ing, tmux behaving weirdly and other stuff. But is I use wsvt25 as my term type, mp3blaster won't work correctly, vim color scheme (I use wombat scheme) will display white background instead of the dark background. So, I have to set my .profile to detect the original term type and change it to the color version.
In console, the original term type is vt220, so I'll use wsvt25 for color but mp3blaster won't work correctly. In X, the term is xterm so I'll use xterm-256color instead.
I open up .profile and put the lines below.
# This is to check the TERM and change accordingly.
if [[ $TERM = xterm ]];
then export TERM="xterm-256color";
else
export TERM="wsvt25";
fi
Then my console and xterm will have appropriate color enabled. Later then.
In console, the original term type is vt220, so I'll use wsvt25 for color but mp3blaster won't work correctly. In X, the term is xterm so I'll use xterm-256color instead.
I open up .profile and put the lines below.
# This is to check the TERM and change accordingly.
if [[ $TERM = xterm ]];
then export TERM="xterm-256color";
else
export TERM="wsvt25";
fi
Then my console and xterm will have appropriate color enabled. Later then.
Subscribe to:
Posts (Atom)
6.5 amd64: Modify existing certbot certificates.
Hi, It's been quite some time eh. As you can see, I still upgrade my OpenBSD system regularly but currently I do not have the time to ...
-
Firstly, yeah I changed the blog's title. As I'm using ONLY OpenBSD nowadays, I think it's appropriate to change the title as I...
-
Hi, First of all, now my K43U machine is using 1366x768 display and no more slow scrolling! Hurrah! I LOVE OPENBSD! At last! The display i...
-
Hi, OpenBSD 5.7 is out and what am I gonna wait for? Ok now I'm running 5.7-CURRENT using snapshot, newly upgraded from 5.7-RELEASE b...