You are not logged in.

#1 2010-07-08 18:48:44

pawn_island
Member
Registered: 2010-06-16
Posts: 18

Linux clearing of screen after command (man, vi, etc.) termination

One small nuisance in perhaps every Linux distro is the clearing of the screen after the execution of commands like man, vim or git. I find this irritating because I might be very interested in seeing the output of say, 'git log' and comparing it with that of a file (cat FILE) that I just edited for a commit.

I came across the '--no-init' command-line option to less(1). Then added alias less='less --no-init' to .bashrc. This works properly if I am explicitly piping the output of a command through less but not when reading a man page. For that I had to export PAGER="less --no-init" again in .bashrc. Moreover, to achieve the same with vim, I am told here:

http://tuxtraining.com/category/applica … line-tools

of the need to setup a configuration variable in .vimrc. I want to know if setting on a per-application basis is the right approach or not? May be this is exactly how it should be. As a user with FreeBSD background this difference is immediately visible. Wonder how they do it there. While I try to find that out on my own, may be I can get few tips on the forum.

Offline

#2 2010-07-08 21:05:47

xamaco
Member
From: Corsica, France
Registered: 2010-04-05
Posts: 87

Re: Linux clearing of screen after command (man, vi, etc.) termination

The variable $LESS can hold default options for less.
In my .bashrc, I have:
export $LESS=-RFX
It sets up the -R -F and -X options...

Offline

#3 2010-07-09 18:41:15

pawn_island
Member
Registered: 2010-06-16
Posts: 18

Re: Linux clearing of screen after command (man, vi, etc.) termination

Thanks xamaco!

Offline

#4 2010-07-09 19:21:22

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Linux clearing of screen after command (man, vi, etc.) termination

> I want to know if setting on a per-application basis is the right approach or not?
I think so. You know, the *nix heritage: many little apps each doing it's own thing :-) I doubt there's a system-wide setting for that.

Offline

Board footer

Powered by FluxBB