Urxvt patch: VTE like clear screen behavior

I've switched to urxvt last week. I come from the VTE world (gnome-terminal, xfce-terminal and such, the latter in my case). VTE has a nice feature to which I've accustomed myself. This is the way how it handles the clear screen function (ctrl-L).
In VTE when you press ctrl-L, the screen cursor position gets to top row and the lines get scrolled just before the visible portion of the window. This means that the scrollback remains intact so you can scroll back and see it later. If you press ctrl-L again when you are at top you get a bunch of empty lines - you can use this to mark the scrollback with empty portions when you are scrolling back large amounts of texts.  This is handy for example when you want to quickly glance at an output from a command but you want to differentiate from different outputs - I press ctr-L several times before I execute the command and then I can just quickly scroll back - I immediately spot where the command began because it has a large black spot before it.
The way urxvt works in this case that it just positions the cursor to the top row and then just erases everything below that point. This means you lose valuable lines from the scrollback. Example: type "seq 1000", press ctr-L. Now you won't see the last lines of the command's output!
Now it is possible that I have a misconfigured urxvt and I'd be interested in the config option which I have misconfigured.
Here's a patch for urxvt which adds proper clear screen function and also adds the VTE-like functionality:
*** src/command.C 2011-10-29 18:06:07.000000000 +0200
--- src/command.C.patched 2011-10-29 18:05:28.000000000 +0200
*************** rxvt_term::process_csi_seq ()
*** 2932,2937 ****
--- 2932,2948 ----
case CSI_CUP: /* 8.3.21: (1,1) CURSOR POSITION */
case CSI_HVP: /* 8.3.64: (1,1) CHARACTER AND LINE POSITION */
+ if (nargs == 1 && current_screen == 0)
+ {
+ // This is usually followed with clear screen so add some extra
+ // lines to avoid deleting the lines already on screen. If we are
+ // already at the top, add an extra screen height of lines.
+ int extra_lines = nrow-1;
+ if (screen.cur.row == 0)
+ extra_lines += nrow;
+ for (int i = 0; i < extra_lines; ++i)
+ scr_add_lines (L"\r\n", 2);
+ }
scr_gotorc (arg[0] - 1, nargs < 2 ? 0 : (arg[1] - 1), 0);
break;
Last edited by rlblaster (2011-10-29 19:07:32)

Now I see what's happening! Your prompt uses '\e[H' which is used as move to home. I assumed that '\e[H' is usually followed with clear screen. This means if you use it to just move the cursor to home it won't work. I don't really see how could I fix this nicely but here's a workaround for your prompt: use '\e[1;1H'. In other words:
PS1=$'%{\e[s\e[1;1H\e[30;42;1m%}[%~][%M] %{\e[K\e[256C\e[8D\e[30;42;1m%} [%D{%H:%M}]%(?,%{\e[32;32m%}\u2588,%{\e[31;41;1m\u2588)%}%{\e[u\e[1A%}\n%{\e[0;32m%}> %{\e[0m%}'
By the way the feature of adding extra blank lines if your cursor is already at top won't work in your prompt because your cursor is always at least on row 1. You could change the patch from
if (screen.cur.row == 0)
to
if (screen.cur.row <= 1)
to have this feature.

Similar Messages

  • Clear Screen Field

    Dear Friends
    I have a Screen and 6 drop down boxes are there with different table references.
    I have use PROCESS ON VALUE-REQUEST block for the getting there serch help values with use FM 'F4IF_INT_TABLE_VALUE_REQUEST'
    my question is when i select One drop down belows are must be clear. that means
    if I select Drop down 2 ==== Drop down 3,4,5,6 must be clear
    if I select Drop down 5 ==== Drop down 5,6 must be clear
    i use in PAI event like CLEAR <Field Name> but its not working
    Can you anyone give me a solution to clear this issue
    Thanks and Regards

    Have a search through the ABAP UI forum for function module 'DYNP_VALUES_UPDATE' examples - you can use this in the way you want to update the value of other screen fields during a POV event i.e. in the F4 for another field.
    If you scroll down through:
    Re: getting the description
    you'll see an example I posted of using this to set text for an associated field, but clear (set to space) should work equally well.
    Jonathan

  • What is function to clear screen ??

    hi,
    What i s function to clear screen .. for example in C-languse we use clrscr();
    like that what is function in java to clear screen.. that is in command prompt window clear

    I dont thik u can do this...
    since u are writing to a stream. so what ever is written is written...
    but if u have any ur own component developed u can do this.
    regards,
    Karthik

  • Clear screen protector application - air bubble removal

    I have bought many clear screen protectors and often have had issues trying to get the air bubbles out from the screen protectors. Sometimes, dust is underneath the protect and when I try to clean it out using the cloth included with the protector, it gets even more dust and then the protector becomes useless. Is there any recommendations on how to best avoid getting air bubbles underneath your screen protector?

    I just received and installed the Incipio Feather case on my iPhone 4. I had it on my 3G and liked it as it is a very slim, unobtrusive case and is like a hard plastic core with a matte, slightly rubbery, velvety surface. I had installed Zagg first, but was displeased with the orange peel surface on the front. I left the Zagg on the back as I do feel it will offer good protection from the back and removed it from the front. The case fit with no problems. The incipio feather comes with 2 hard clear screen protectors with a hole for the front camera, and the front protectors are MUCH better than having the rubbery, lumpy Zagg on the front screen and don't require any liquid to apply. I was hoping I would get one crystal screen protector and one matte protector as I did when I used Power Support screens in the past, but they are both clear. The surface is smooth and nice. I don't have any loss of signal now when I hold the phone in my palm cupping the lower left side. I probably slightly prefer the matte power support screen as it is easier to keep clean, but power support is not shipping yet. If I had to do it over again I would skip the Zagg and just get the incipio. Just my 2 cents and thought I'd share my experience.
    http://www.myincipio.com/product/IPHONE4IPH-512/Matte-Black-Ultra-Light-featherÂ-Slim-Form-Fitted-Case-for-iPhone-4.html

  • Clear screen Method / pause method?

    Are there any clear screen methods or pause methods I can use in swing? I'm new to java and am attemting to write a simple applet with a few images on it, do these methods exist?
    thanks!
    Clay

    Not sure. But if you make the system read a byte the screen will pause until you press enter. This is a dos screen however. Something like this:
         try
                   byte[] b = new byte[2];
                   System.in.read (b);
              } catch (IOException ex) {}

  • About Lot 3x Film Cover LCD Clear Screen Protector for iPad Mini

    I'm getting Lot 3x Film Cover LCD Clear Screen Protector for iPad Mini on eBay.com in the Mail tomorrow but i have 1 question if I Bring My Apple iPad Mini 16GB WiFi Only Tablet to The Apple Store tomorrow will they put on the Lot Film Cover LCD Clear Screen Protector on My Apple iPad Mini if i asked them to??? cause I Don't know how to do it, My House is Very Dusty yes even if i try to do it myself yeah i have to many Electronics in my house yes I Need Help, I Do have an Apple iPhone 5 64GB From Verizon Wireless should i try going there to if they can't help me at The Apple Store???
    Sorry i'm being very Annoying to bother anyone here, i know you don't like it?

    You know, it's ok to ask! If I was you, I'd try asking them at the Apple store or, if you got the iPad at the Verizon store, go there. It won't hurt to ask - just tell them you don't know how to do it and don't want to mess it up. It's a little difficult to do it right - I got that kind of thing for my Macbook Pro for the bottom where your hand rests and had a hard time putting it on. So, go ahead and ask. If they're too busy, read the instructions a couple of times and wait until you have plenty of time and are relaxed and try it yourself.
    I know you can do it if necessary!

  • My iphone 4 the screen was totally blanck like white screen nothing is visible it is in 90 days warranty now i am new delhi

    my iphone 4 the screen is totally blank like white screen nothing is visible.replacment done in dadeland mall apple store on 19th of janvaury 2014 this month and it has got 90 days warranty.now i am in new delhi,India.I have called to apple care USA and they have given the toll free number of india they said it a hardware problem and this has to replace only in USA .now i am not going to USA so i would like to request you that please arrange to replace or repair my iphone 4 in apple care centre at new delhi as this iphone has a warranty just they can send the message and apple care people will take care over here as i bought many product from Usa like HP laptop ,sony camera and other things and they have given the international warranty and over here all the sevice centre will take care so why not apple care peoples take care?
    i am waiting for your favorable action and reply
    thanks
    Rajeev Gupta

    Please disregard this question. I'll submit a shorter and more direct question. Thanks.

  • Clear Screen, Sql plus Error, in release 10.2.0.1.0

    Hi there,
    I'm having problem in using clear screen command in SQLPlus utility of Oracle Release 10.2.0.1.0. When executing clear screen in SQL Plus ( in command prompt) in windows machine, suddenly a dialogue box opens and saying that "SQLPlus encountered an error and sorry for inconvenience "
    Is this the problem with OS or Oracle Client?
    Could anyone please help me in resolving this issue?
    Thanks
    Raja

    So that is the problem with Oracle client only, not with the OS configuration and all.... shall i assume?

  • After having downloaded the free version of Maverick OS X, HD version, I haven`t got a clear screen anymore and even on my photos lots of scratches in different colours appear. It seems to me that something went wrong.

    Since I have downloaded the free version Maverick OS X, HD version, from the App Store, I haven`t got anymore a clear screen whenever I open a page. Scratches and stripes appear and this is especially annoying when I wanna have a look on my downloaded photos from my iPhone 5 S. Does anybody know a solution ? Maybe somebody is struggling with the same problem.

    I'm not sure what you mean by HD Version. There is only one Mavericks and I find nothing about HD.
    Perhaps you have the display resolution set wrong for your display.

  • Out of memory, clear screen, cannot boot, no icons

    I have lost all icons. Cannot boot without a hard boot. Clear screen.
    All day long it said out of memory. I have 10gb. I cannot even access utilities or any programs.
    Really lost.

    http://www.macmaps.com/diskfull.html
    http://www.thexlab.com/faqs/freeingspace.html
    https://discussions.apple.com/thread/2804827?threadID=2804827
    Boot from another drive then. Don't have one, then boot from OS X DVD : Restore : and copy (clone) 'source' your drive to a new 'target' drive
    http://macperformanceguide.com/Mac-HowToClone.html
    http://macperformanceguide.com/Mac-HowToClone-backup.html

  • Lumia 930 app like glance screen

    I need some app which will work something like glance screen - peak option. I have Nokia cp-637 case, and wish some applications which will turn on screen when I open cp-637 case.
    Something like on Samsung.

    Hello, sssrki. Thanks for posting your concern in the community. You're correct. The Lumia 930 does not support Glance screen feature: http://www.microsoft.com/en-gb/mobile/support/faq/?action=singleTopic&topic=FA143602. Have you tried checking the Store for any similar app? This link may help: http://www.windowsphone.com/en-us/store/search?q=glance.
    Keep us posted.

  • Adobe Reader can`t print like on screen

    2012Y. Years and years. Reader can not print like on screen. Even with the option - print as a picture. Only version 7.0 can.
    [Edited by host]

    With no information as to your version of Reader, OS, and an example of what prints wrong you are just venting. You are not asking for help.

  • "clear screen" command exits sqlplus

    Hi,
    I am running a 10gR2 database. when I issue "clear screen" command at the sqlplus prompt, it throws me out of the sqlplus. there are no error messages.
    anybody having the resolution ?
    thanks.

    I got it ... its a bug in 10.2.0.1, the version which I m using
    bug 4595395      CLEAR SCREEN causes SQLPLUS command line to dump
    this is resolved in 10.2.0.2 patchset. Note: 358749.1
    thanks.

  • Clear screen from sql file

    at sqlplus prompt, I can type either HOST CLS or CLEAR SCREEN and both work..
    but when I put either of them in an .sql file and run it from sql with @c:\file.sql
    both commands error with:
    ORA-06550
    PLS-00103 encountered 'CLS' or 'SCREEN'
    OS IS Windows 7 with Oracle 11.1.0.6 client
    my goal is to run a dbms_output line while in a loop
    so the data shows on the screen and refreshes when it is changed
    without clearing the screen, it just shows over and over and scrolls by a list of them very fast

    Merlin128 wrote:
    at sqlplus prompt, I can type either HOST CLS or CLEAR SCREEN and both work..
    but when I put either of them in an .sql file and run it from sql with @c:\file.sql
    both commands error with:
    ORA-06550
    PLS-00103 encountered 'CLS' or 'SCREEN'
    OS IS Windows 7 with Oracle 11.1.0.6 clientThe SQL*Plus CLEAR SCREEN command works for me.
    my goal is to run a dbms_output line while in a loop
    so the data shows on the screen and refreshes when it is changed
    without clearing the screen, it just shows over and over and scrolls by a list of them very fastSorry, I don't think you can do that.
    Dbms_output does not display anything while the PL/SQL code is running. In fact, it doesn't actually display anything, ever. Dbms_output merely puts text to be displayed into a buffer. When control returns to SQL*Plus, then SQL*Plus displays all of the buffered text together. So if your PL/SQL block consists of a loop that takes 10 seconds per iteration, and you go through the loop 6 times, you will wait a full 60 seconds before seeing any output, and then see all 6 lines as quickly as PL/SQL can display them.

  • Clear screen in "Run SQL Command Line" causes the utility to dump in Window

    Just for your notice... I have not checked if i can reproduce this on Linux platform or on second node running Windows XP Pro.
    But if I use "Run SQL Command Line" utility and do
    clear screen
    The utility dumps, (not the database though only the utlility)
    Maybe some other people could confirm if this findings is a bug or not and if it is a port specific issue with Windows XP only.
    Kindly Rgds
    /Ulf, Kentor IT Sweden

    Tracking info is in
    Re: SQL*Plus generated Program Error
    -- cj

Maybe you are looking for