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

Re: sluggish prompt



On Oct 7,  3:12am, Russell Hoover wrote:
} Subject: Re: sluggish prompt
} 
} It hangs after any inactivity.

This, and your earlier remark that it happens "after exiting a program",
would tend to indicate that zsh has become swapped out and it's taking
the operating system a long time to swap it back again.  Have you
looked at the output of "ps" (with appropriate options, which vary by
operating system; perhaps "ps up$$" would work) to see how much memory
your shell is consuming?

Are you having this problem on a personal workstation, when logging in
to a shared server, or in some other situation?  How busy is the system
in general?

} I think I made a few adjustments to the rc recently after starting
} to use zsh-3.4.3.  One thing I noticed in the read-out that it kept
} repeating all the different filenames for lines 251 & 253 over & over.

It's not clear from your series of messages whether this happened only
when you started the shell, or every time there was a prompt.

If only at startup, then it's not something to worry about.

} Here are those lines:
} ----------------------------------------------------
} 248 for dirname in $fpath
} 249 do
} 250   for files in $dirname/*(:t)
} 251   do
} 252     autoload $files
} 253   done
} 254 done
} ------------------------------------------------------

I believe you could replace that entire loop with

	autoload ${^fpath}/*(N-.:t)

} The lines I quoted that kept repeating whenever I hit return
} I now notice are from the rcfile:
} -------------------------------------------------------
} 233 function precmd {
} 234         local exitstatus=$?
} 235         psvar[1]=SIG
} 236         [[ $exitstatus -ge 128 ]] && psvar[1]=SIG$signals[$exitstatus-127]
} 237 #        [[ $psvar[1] = SIG ]] && psvar[1]=$exitstatus
} 238 #        jobs % >& /dev/null && psvar[2]=""  || psvar[2]=()
} 239         psvar[2]=$#jobstates; [[ $psvar[2] -eq 0 ]] && psvar[2]=()
} 240 }
} --------------------------------------------------------
} 
} Not sure why the two lines are commented out -- these lines were
} definitely copied, though almost all of the rest of the file is not.

They're probably commented out because they are a cruder/older way to
accomplish the equivalent of the one line following them.
 
} At the risk of overkill here's the whole file, thanks for helping:

There's nothing alarming in there.  Leave the "set -x" out of your rc
file and instead edit your precmd to be:

    function precmd {
	local exitstatus=$?
	print -u2 PRECMD
	psvar[1]=SIG
	[[ $exitstatus -ge 128 ]] && psvar[1]=SIG$signals[$exitstatus-127]
	psvar[2]=$#jobstates; [[ $psvar[2] -eq 0 ]] && psvar[2]=()
    }

Now watch carefully.  When you get the 6-10 second delay, does it happen
before or after the word PRECMD is printed?

Do you have anything in other init files such as .zlogin, .zprofile, etc.?



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