Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: zsh script wipes out my PROMPT and RPROMPT



On Jan 24,  3:23pm, Timothy J Luoma wrote:
} Subject: zsh script wipes out my PROMPT and RPROMPT
}
} This script wipes out the PROMPT and RPROMPT

Can you explain further, please?

If you run this as an actual script, it -shouldn't- be able to have any
effect on your prompt at all, because it runs in a second shell.

If you run this as a shell function (e.g. by autoloading it), the "exit 0"
at the end should kill the shell entirely.

If you source or execute as a function this script from your .zlogin or
other init file, the "exit 0" will abort reading that file, which will of
course leave unfinished anything that appears later in the file.  My guess
is that this is what you're seeing, and that if you get rid of "exit 0"
then things will improve.

Another problem is that

LINES=`wc -l $FILE | awk '{print $1}'`

is changing zsh's idea of the size of your terminal; LINES is a reserved
variable name, along with COLUMNS.  You shouldn't use it as a temporary.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



Messages sorted by: Reverse Date, Date, Thread, Author