# how to prevent clear screen after less or more commands under tmux?



## salam4ik (Apr 22, 2010)

Hi to all!
How to prevent clearing screen after less or more commands under tmux? I noticed that in terminal without tmux it works. And in man I have found nothing about it:-(
Thank you for your help!


----------



## phoenix (Apr 22, 2010)

You've changed the defaults somewhere.

The default behaviour of the more(1) command is to not clear the screen.  Same for less(1) (since they're actually the same binary, on FreeBSD).

Check if you have $LESS defined anywhere in your shell startup scripts.

Double-check your tmux settings as well.


----------



## graudeejs (Apr 22, 2010)

if you're using urxvt in ~/.Xdefaults i think you need to remove *URxvt*buffered: true*

That is if you have it


----------



## salam4ik (Apr 23, 2010)

Thank you guys for reply!
I have found solution, the screen clearing can be prevent by command below:

```
set-window-option -g alternate-screen off
```
And now it works properly.


----------



## graudeejs (Apr 23, 2010)

where do you set this, and for which app it is?


----------



## salam4ik (Apr 23, 2010)

It is tmux command, that can run from tmux command prompt or from tmux.conf file.


----------



## fronclynne (Apr 26, 2010)

I must say, I'd just learned to accept that it worked that way, thanks for the research, *salam4ik*.


----------

