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

Re: Alternate patch Re: PATCH: New prompt themes



On Oct 21,  9:54am, Oliver Kiddle wrote:
} Subject: Re: Alternate patch Re: PATCH: New prompt themes
}
} > Further, I might suggest that instead of an assoc. array with both set and
} > unset values, just use a regular array of only the values that are meant to
} > be set; e.g. one command instead of a loop:
} >   setopt noprompt{bang,cr,percent,subst} prompt$^prompt_opts
} > However, I didn't make that change either.
} 
} That probably is better. An alternative patch to do it that way
} follows.

In that case:

Index: Functions/Prompts/prompt_oliver_setup
===================================================================
@@ -17,7 +17,7 @@
 }
 
 prompt_oliver_setup() {
-  prompt_opts=( percent set )
+  prompt_opts=( percent )
   
   local pcol=$'\e['${1:-${pcolour[${HOST:=`hostname`}]:-33}}m
   local tcol=$'\e['${2:-${tcolour[$HOST]:-37}}m

} The only thing I'm not sure about is whether it is wise that
} promptcr is controlled by the prompt themes. I'd consider it to be
} down to personal preference whether it's set or not. I also can't see
} that it could be crucial to a particular theme so you might want to
} remove cr from the brace expansion.

I can't make up my mind about this.  If you're going to remove it from
the brace expansion, then you should probably also filter it out of the
value of prompt_opts.  On the other hand, almost no fancy prompt -- and
certainly not one that uses the width of the screen and/or an RPROMPT --
works correctly when promptcr is turned off.  Even Zle doesn't work very
well when it only thinks it started out in the leftmost column.


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



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