You are not logged in.

#1 2007-05-02 20:30:27

Kei
Member
Registered: 2007-04-05
Posts: 88

Bash behaviour

When I issue a command like 'man foo', 'cat foo | less' or anything like that, I'd the screen to be reverted to its former state after execution. I noticed that when the environmental var TERM is "xterm", this is happening. The only problem: VIM changes its color scheme. If I use 'TERM=linux vim foo', the color fits, but the file remains on screen when I close vim. hmm

Any ideas?

Offline

#2 2007-05-02 22:02:57

hightower
Member
Registered: 2006-04-02
Posts: 182

Re: Bash behaviour

Hi,

does this behaviour show up on the virtual console or in an X session?

hightower

Offline

#3 2007-05-02 22:25:58

Kei
Member
Registered: 2007-04-05
Posts: 88

Re: Bash behaviour

When I use tty the env var is set to TERM=linux. Every application, including less and vim, are sending their output directly to the console, instead of making a "new instance" - I don't really know how to call it. Anyway, Konsole sets this var to "xterm", as every X terminal emulator does.

Offline

#4 2007-05-03 16:00:10

Leffe
Member
Registered: 2006-05-30
Posts: 47

Re: Bash behaviour

The screen is restored only if the program that changes the screen writes to the alternative screen, and the programs will only do that if the termcap entry for the terminal advertises the ti and te capabilities (can be checked with infocmp -1Cr $TERM | egrep ':ti|:te').

As for the colors... I'm not sure what kind of problem you are having, but you could try setting TERM to xterm-256color. Vim also has an option that allows you to force Vim to try using more colors, t_Co.

Offline

#5 2007-05-03 18:04:55

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

Re: Bash behaviour

Kei wrote:

Anyway, Konsole sets this var to "xterm", as every X terminal emulator does.

No they don't.  Actually, setting the TERM value to xterm when it is not xterm causes most of the terminal problems people have.  urxvt uses TERM=rxvt-unicode, for instance, and setting the TERM value to xterm causes numerous keys to not work, as well as some redrawing problems.

Offline

Board footer

Powered by FluxBB