You are not logged in.

#1 2009-05-21 16:22:12

Xyne
Forum Fellow
Registered: 2008-08-03
Posts: 6,965
Website

[SOLVED]How do you clear the urxvt buffer?

Xyne's nooblog entry #453-J897X:

How do you clear the urxvt buffer? In Terminal, I used to use this alias: cls='reset && clear'
That would get rid of all output in the terminal, including previous off-screen lines.

Using the same alias in urxvt, I can still scroll up to see all previous output. I've also tried "tput reset" to no avail.

Just to be clear, I know that I can configure the number of lines that urxvt saves (I've set it to save 10000). I do not want to disable this feature completely. I just want to have control over it so that I can reset those lines easily.

Starting a new instance is not ideal either as I then lose the command history.

If it makes any difference, I'm using rxvt-unicode-256color from the AUR.

Last edited by Xyne (2009-05-21 19:29:40)


My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone

Offline

#2 2009-05-21 16:41:39

skualito
Member
Registered: 2008-11-19
Posts: 203

Re: [SOLVED]How do you clear the urxvt buffer?

Here with clear I can still scroll the lines up, I can't with reset, and the alias to 'reset && clear' is working as expected, I use urxvt from extra though.

Offline

#3 2009-05-21 17:03:51

Xyne
Forum Fellow
Registered: 2008-08-03
Posts: 6,965
Website

Re: [SOLVED]How do you clear the urxvt buffer?

Thanks for the reply, skualito.

After confirming that the package in extra behaves as expected, I added its configuration options to the PKGBUILD from the AUR. It seems to work as expected now.


My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone

Offline

#4 2009-05-21 17:27:43

fflarex
Member
Registered: 2007-09-15
Posts: 466

Re: [SOLVED]How do you clear the urxvt buffer?

Maybe I'm missing something, but this does not work for me using the package from extra. I was about to reply saying that it can't be done.

For me, I can only clear the buffer completely when the screen has never filled up in the first place. If it has already been forced to scroll down, it doesn't work.

Offline

#5 2009-05-21 18:07:05

Xyne
Forum Fellow
Registered: 2008-08-03
Posts: 6,965
Website

Re: [SOLVED]How do you clear the urxvt buffer?

#$#%%#^$%^$

You're right. I didn't fully test it... it just seemed to be working.

Why though? Why is this possible in other terminal emulators but not with urxvt?


My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone

Offline

#6 2009-05-21 18:15:47

fflarex
Member
Registered: 2007-09-15
Posts: 466

Re: [SOLVED]How do you clear the urxvt buffer?

I don't really know why. It does have a lot of options related to scrolling that I haven't fiddled with, though. One of them may fix it (let me know if does). Urxvt also has one major feature that other terminals don't... perl extensions. You could maybe write one to fix this behavior if it bothers you that much.

Offline

#7 2009-05-21 18:18:00

skualito
Member
Registered: 2008-11-19
Posts: 203

Re: [SOLVED]How do you clear the urxvt buffer?

I tried filling up the screen , forcing it to scroll down, and then a reset or tput reset actually clears the screen, no scrollback possible, is there something I don't get ?

Edit: I just found this alias that "seems" to work for me

alias cls="echo -ne '\033c'"

Is it working for others ?

Last edited by skualito (2009-05-21 18:25:12)

Offline

#8 2009-05-21 18:20:53

Xyne
Forum Fellow
Registered: 2008-08-03
Posts: 6,965
Website

Re: [SOLVED]How do you clear the urxvt buffer?

How do you normally scroll back?

I use the mouse wheel or Shift+PgUp (I've disabled scrollbars).


My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone

Offline

#9 2009-05-21 18:38:15

skualito
Member
Registered: 2008-11-19
Posts: 203

Re: [SOLVED]How do you clear the urxvt buffer?

I also use Shift+PgUp without scrollbars, I confirm that I can not scroll back after a 'reset' or "echo -ne '\033c'"

Offline

#10 2009-05-21 18:39:38

fflarex
Member
Registered: 2007-09-15
Posts: 466

Re: [SOLVED]How do you clear the urxvt buffer?

I just fixed the problem for me by commenting out 'URxvt*termName: rxvt' in my ~/.Xdefaults file. (Doesn't work under screen, however.)

Last edited by fflarex (2009-05-21 18:46:44)

Offline

#11 2009-05-21 19:24:39

andre.ramaciotti
Member
From: Brazil
Registered: 2007-04-06
Posts: 649

Re: [SOLVED]How do you clear the urxvt buffer?

reset works fine here, too. (I'm using the urxvt from extra)

edit: BTW, I was wondering why C-L or clear don't work this days. I didn't know about reset.

Last edited by andre.ramaciotti (2009-05-21 19:25:35)


(lambda ())

Offline

#12 2009-05-21 19:28:32

Xyne
Forum Fellow
Registered: 2008-08-03
Posts: 6,965
Website

Re: [SOLVED]How do you clear the urxvt buffer?

skualito wrote:
alias cls="echo -ne '\033c'"

This seems to work for me. Thanks.


My Arch Linux Stuff • Forum Etiquette • Community Ethos - Arch is not for everyone

Offline

#13 2010-12-22 09:10:33

sickill
Member
Registered: 2010-01-12
Posts: 10

Re: [SOLVED]How do you clear the urxvt buffer?

skualito wrote:

Edit: I just found this alias that "seems" to work for me

alias cls="echo -ne '\033c'"

Is it working for others ?

Working great for me, thx.

Offline

#14 2013-09-05 12:46:49

eel
Member
Registered: 2013-09-05
Posts: 1

Re: [SOLVED]How do you clear the urxvt buffer?

Thanks for the tip.

In order to use it as a keybind (instead of a shell alias), I add

URxvt.keysym.C-k:       echo -ne '\\033c'\n

to my ~/.Xressources

Offline

#15 2013-09-05 17:58:21

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [SOLVED]How do you clear the urxvt buffer?


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

Board footer

Powered by FluxBB