You are not logged in.

#1 2007-02-01 01:04:09

elasticdog
Member
From: Washington, USA
Registered: 2005-05-02
Posts: 995
Website

screen, $TERM, and weechat...oh my!

I'm having some issues here that I haven't been able to track down for the life of me.  Admittedly I don't understand much about termcap and the $TERM environment variable and whatnot (to tell the truth, it confuses the hell out of me), but here's what's happening.  Weechat displays perfectly, just as it should, when I'm using it on just the plain command line.  The main thing to notice is the vertical bar that shows the separation between the nicklist and the channel:

weechatfj5.th.png

As soon as I log in to screen and load weechat, this is what I see:

weechatwithscreensl6.th.png

When I'm outside of screen, my $TERM is set to xterm by default (I don't set it specifically, since I understand that's supposed to be bad??), and when I'm within screen it is set to screen.  Which also makes me wonder if I need to do anything to support 256 colors, but this is definitely a bigger issue.  If I simply disable the nicklist in weechat, it seems to display fine, but obviously something is still not right.

I know that weechat is ncurses-based, and I can also tell you that I'm running with UTF-8 as my locale (and the $LANG variable is properly set to en_US.UTF-8).  This is driving me bananas...any thoughts?

Offline

#2 2007-02-01 01:28:40

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,019

Re: screen, $TERM, and weechat...oh my!

Hym, just checked how weechat looks in screen on my box - no problem there, looks the same as outside screen. All the settings you mentioned are the same.

I don't know what's wrong, but if you're using weechat from repo, you might try to update to 2.3 (there were bugs with nicklist on top/bottom and disabled separator).

Offline

#3 2007-02-01 02:07:09

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: screen, $TERM, and weechat...oh my!

This happens to me as well, but my setup is different.
I run screen on a server, start a screen session on my laptop, ssh to the server and reattach.
So I have screen-in-screen and it looks exactly the same.

Mutt has the same problem with screen-in-screen.  Both of these apps work fine from my laptop (one screen, not two).

I honestly think this has something to do with the terminfo file move of "screen-256color" from the screen package to the ncurses package.

Offline

#4 2007-02-01 02:24:41

elasticdog
Member
From: Washington, USA
Registered: 2005-05-02
Posts: 995
Website

Re: screen, $TERM, and weechat...oh my!

Well...it just got a bit more interesting.  those screenshots were from a windows box at work ssh-ing in to my machine at home.  I just tried it with putty, and there were absolutely no issues, so apparently it's just SecureCRT and something it's doing wrong.  I messed with all of their emulation options and didn't get any improvement.  I'm at home for lunch right now and testing everything locally on my Arch box directly, and it displays as it should. So, it looks like I can just use putty while at work, but it would seem there are definitely still some oddities when using ncurses within screen.

Looking in to all of this stuff made me realize that I don't think I'm using a 256 color terminal by default.  I've read that it's bad to specifically set your $TERM variable, so what would be the proper way to get it set?

Offline

#5 2007-02-01 02:57:46

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: screen, $TERM, and weechat...oh my!

elasticdog wrote:

Looking in to all of this stuff made me realize that I don't think I'm using a 256 color terminal by default.  I've read that it's bad to specifically set your $TERM variable, so what would be the proper way to get it set?

It's generally bad to set it.  You should let the terminal itself set it.

screen controls itself for the most part, but for 256 colors, you want the following in your .screenrc:

term screen-256color

screen will automatically append other stuff (for instance, mine is screen-256color-bce because I have "defbce" set).

Offline

#6 2007-02-01 03:00:59

elasticdog
Member
From: Washington, USA
Registered: 2005-05-02
Posts: 995
Website

Re: screen, $TERM, and weechat...oh my!

What about for the terminal outside of screen though?  I tried specifying it in .zshrc once, but then screen would use that setting as well and things once again were messed up with ncurses, but in a different way.

Offline

#7 2007-02-01 07:37:47

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: screen, $TERM, and weechat...oh my!

elasticdog wrote:

What about for the terminal outside of screen though?  I tried specifying it in .zshrc once, but then screen would use that setting as well and things once again were messed up with ncurses, but in a different way.

The terminal outside screen should do what it does by default.  Some terminals need a "push" in the right direction (i.e. xterm can specify itself as xterm-256color) - for that, I'd recommend setting it in ~/.Xdefaults (xterm*termName: xterm-256color) so that it only sets the term value for xterm, and not every terminal you use.  IMO xterm is a bit broken in that regard.  It should function similar to screen, in that it detects what capabilities it has and sets the TERM accordingly (screen-bce, screen-w, screen-bce-w are all TERM values screen can set itself to).

Offline

#8 2007-02-02 01:37:27

elasticdog
Member
From: Washington, USA
Registered: 2005-05-02
Posts: 995
Website

Re: screen, $TERM, and weechat...oh my!

Great...thanks for the help phrak.

Offline

Board footer

Powered by FluxBB