From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3437 invoked from network); 19 Mar 2000 03:51:26 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 19 Mar 2000 03:51:26 -0000 Received: (qmail 14546 invoked by alias); 19 Mar 2000 03:51:05 -0000 Mailing-List: contact zsh-users-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 2975 Received: (qmail 14532 invoked from network); 19 Mar 2000 03:51:03 -0000 From: "Bart Schaefer" Message-Id: <1000319035053.ZM32550@candle.brasslantern.com> Date: Sun, 19 Mar 2000 03:50:53 +0000 In-Reply-To: Comments: In reply to nirva@ishiboo.com (Danny Dulai) "Re: clear to end of display" (Mar 18, 10:55pm) References: X-Mailer: Z-Mail (5.0.0 30July97) To: nirva@ishiboo.com (Danny Dulai) Subject: Re: clear to end of display Cc: zsh-users@sunsite.auc.dk MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Mar 18, 10:55pm, Danny Dulai wrote: } Subject: Re: clear to end of display } } On 03/18/00, Bart Schaefer said: } >What's the problem with having a clear-eol after the prompt? } } Well, I have a prompt that displays the time and my login/host in the upper } right of the screen. If it's always in the upper right, you might try printing it with a TRAPALRM() function rather than putting it in the prompt. Time values in the prompt don't get updated until after the next call to precmd(), but by setting a TMOUT value you can have it updated almost as often as you like (though I wouldn't recommend more often than about every 10 seconds or it'll interfere with your typing). I update the time in my xterm title bar that way, with a 60-second TMOUT. } when the prompt is on the first two lines of the } terminal, the line the prompt is on gets cleared to eol, and overwrites } some of my prompt in the upper right. I have hacks in there so that clear, } ^L, and reset, do an echo twice to move the cursor down two lines, but I } was hoping to avoid that. Try putting a cursor-up cursor-down movement in a %{...%} block at the beginning of your prompt. That should force the prompt to be no higher than the second line without needing to hack any zle widgets. E.g. in 3.1.6+ with an 80-column xterm: PS1="%{"$'\e7\e[1A\e[1B\e[1;1H'%E$'\e[1;72H'"%D{%I:%M:%S}"$'\e8'"%}%m%# " } Also, the reason eod is annoying me is due to uneccessary clears on a } transparent terminal that cause it to slightly flicker. I know this is the } fault of the terminal program, but its a fault I'd like to work around, } since it can't be fixed very easily. Here's a trick that should work ... Copy your transparent terminal's termcap or terminfo entry to another name and remove the clear-eod capability. Suppose the names are `trans' for the original and `trans_no_ceod' for the edited copy. Then do: precmd() { TERM=trans_no_ceod } preexec() { export TERM=trans } This hides the clear-eod from zsh while the prompt is printing, without hiding it from other commands that run. If you're using a termcap-based system, you should be able to use the TERMCAP variable instead, and just insert and delete the `cd=' capability without changing TERM. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com