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

esc seq in prompt



Hi,                                                                             
                                                                                
I'm having a small trouble with the command-line completion                     
system when I have escape sequences in my PROMPT environment variable.          
                                                                                
Basically, the cursor jumps to the right of screen (spaces are                  
inserted?) & confuses the hell out of mE when I hit TAB in a                    
directory & get multiple matches.                                               
                                                                                
Below is a copy of the *entire* .zshrc file I'm using to try &                  
debug this. I'd love some help or a pointer to get around this.                 
                                                                                
burns>> echo $ZSH_VERSION                                                       
3.1.9-dev-1                                                                     
burns>> uname -a                                                                
Linux burns 2.2.12-20 #1 Mon Sep 27 10:40:35 EDT 1999 i686 unknown              
                                                                                
=== cut: .zshrc ===                                                             
                                                                                
setPrompt ()                                                                    
{                                                                               
        rv=$?                                                                   
        local red green white errno color1 color2                               
        red=`print -nP '\e[\033[31;;1m'`                                        
        green=`print -nP '\e[\033[32;;1m'`                                      
        white=`print -nP '\e[\033[37;;1m'`                                      
        errno=""                                                                
        if [ $rv = 0 ] ; then                                                   
                color1=$green                                                   
                color2=$green                                                   
        else                                                                    
                color2=$red                                                     
                if [ $rv = 1 ] ; then                                           
                        color1=$green                                           
                else                                                            
                        color1=$red                                             
                        if [ $rv != 2 ] ; then                                  
                                errno="($rv)"                                   
                        fi                                                      
                fi
        fi                                                                      
        export PROMPT=$green$MACHINE$color1$errno">"$color2"> "$white           
}                                                                               
                                                                                
export MACHINE=`uname -n`                                                       
                                                                                
precmd ()                                                                       
{                                                                               
        setPrompt                                                               
}                                                                               
                                                                                
=== end: .zshrc ===                                                             
                                                                                
SCoTT! :)                                                                       
--------------------                                                            
scott@xxxxxxxxxxxxxx



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