I have one patch for zsh (currently 4.3.2). It works (only) along my patch for rxvt.
It exports the selection to rxvt (which exports it as X selection), thanks to an Escape sequence.
History:
(setenv ;variable "TASK" "amule")
then:
if [ ! -d $TASK ]
then
HISTFILE=~/.zsh_history/$TASK
echo "your HISTFILE is $HISTFILE"
if [ -x ~/.tasks/${TASK}.rc ];
then
source ~/.tasks/${TASK}.rc
fi
fi