zsh multiline prompt and windows lock problem [7]

zsh multiline prompt and windows lock problem

Thursday, March 5, 2009 6:41 AM - JP

Hello,

I'm using xshell to connect on linux box with zsh. I have reconfigured my prompt to have a multiline prompt:

-[user@host]-[15:38]-[~]-
->

Since then, each time I unlock my windows station with xshell on foreground, the first line of my prompt get repeated two additional times. So, after unlocking, I get on the screen :


-[user@host]-[15:38]-[~]-
-[user@host]-[15:38]-[~]-
-[user@host]-[15:38]-[~]-
->

where I had previously my correct prompt.

any idea ?

Program Ver. : Xshell 3.0

EDIT: in fact, it's the case even if xshell in not the foreground app, but it's only on the selected tab, and not on the others.
EDIT: same effect in case of "Restore" or "Maximise" of xshell window


Re: zsh multiline prompt and windows lock problem

Wednesday, March 11, 2009 12:07 PM - Support

We have tried duplicating the problem but could not. If you could send us more information, we will it again. Please send us the following information:

1. Prompt string script and how it is applied.
2. Name/version of UNIX
3. What do you mean by lock/unlock?



---
Technical Support


Did you know that Xshell and Xftp are free for home and school use? To find out more, please click here.


Re: Re: zsh multiline prompt and windows lock problem

Friday, March 13, 2009 2:14 AM - JP

At the end is the zsh ressource file defining my prompt.
It is sourced in .zshrc with "source .prompt2"

It's on a SuSE Linux (Linux version 2.6.5)

By lock/unlock, I simply mean locking or unlocking my windows XP PC on which I'm running xshell to connect to the linux boxes.

Regards,
JP

".prompt2" :
----------------------------
typeset -A PR_STUFF

autoload colors zsh/terminfo
if [[ "${terminfo[colors]}" -ge 8 ]]
then
colors
fi
for color in CYAN WHITE YELLOW MAGENTA BLACK BLUE RED DEFAULT GREY GREEN
do
PR_STUFF[${color}]="%{${fg_bold[${(L)color}]}%}"
PR_STUFF[LIGHT_${color}]="%{${fg[${(L)color}]}%}"
PR_STUFF[BG_${color}]="%{${bg_bold[${(L)color}]}%}"
PR_STUFF[BG_LIGHT_${color}]="%{${bg[${(L)color}]}%}"
done


PR_STUFF[ITALIC]="%{${terminfo[sitm]}%}" # enter_italics_mode
PR_STUFF[END_ITALIC]="%{${terminfo[ritm]}%}" # exit_italics_mode
PR_STUFF[DIM]="%{${terminfo[dim]}%}" # enter_dim_mode
PR_STUFF[BLINK]="%{${terminfo[blink]}%}" # enter_blink_mode
PR_STUFF[NO_COLOR]="%{${terminfo[sgr0]}%}" # exit_attribute_mode (turn off all attributes)

typeset -A altchar
set -A altchar ${(s..)terminfo[acsc]}
PR_STUFF[SET_CHARSET]="%{${terminfo[enacs]}%}" # enable_alternate_char_set
PR_STUFF[SHIFT_IN]="%{${terminfo[smacs]}%}" # enter_alt_charset_mode
PR_STUFF[SHIFT_OUT]="%{${terminfo[rmacs]}%}" # end_alternate_charcter_set
typeset -A ACS
ACS[STERLING]=${altchar[\}]:- } # UK pound sign
ACS[DARROW]=${altchar[.]:- } # arrow pointing down
ACS[LARROW]=${altchar[,]:-<} # arrow pointing left
ACS[RARROW]=${altchar[+]:->} # arrow pointing right
ACS[UARROW]=${altchar[-]:-^} # arrow pointing up
ACS[BOARD]=${altchar[h]:-#} # board of squares
ACS[BULLET]=${altchar[~]:-#} # bullet
ACS[CKBOARD]=${altchar[a]:-#} # checker board (stipple)
ACS[DEGREE]=${altchar[f]:-#} # degree symbol
ACS[DIAMOND]=${altchar[\`]:-+} # diamond
ACS[GEQUAL]=${altchar[z]:->} # greater-than-or-equal-to
ACS[PI]=${altchar['{']:-#} # greek pi
ACS[HLINE]=${altchar[q]:--} # horizontal line
ACS[LANTERN]=${altchar[i]:-#} # lantern symbol
ACS[PLUS]=${altchar[n]:-+} # large plus or crossover
ACS[LEQUAL]=${altchar[y]:-<} # less-than-or-equal-to
ACS[LLCORNER]=${altchar[m]:-+} # lower left corner
ACS[LRCORNER]=${altchar[j]:-+} # lower right corner
ACS[NEQUAL]=${altchar[|]:-!} # not-equal
ACS[PLMINUS]=${altchar[g]:-#} # plus/minus
ACS[S1]=${altchar[o]:-_} # scan line 1
ACS[S3]=${altchar[p]:-_} # scan line 3
ACS[S7]=${altchar[r]:-_} # scan line 7
ACS[S9]=${altchar[s]:-_} # scan line 9
ACS[BLOCK]=${altchar[0]:-#} # solid square block
ACS[TTEE]=${altchar[w]:-+} # tee pointing down
ACS[RTEE]=${altchar[u]:-+} # tee pointing left
ACS[LTEE]=${altchar[t]:-+} # tee pointing right
ACS[BTEE]=${altchar[v]:-+} # tee pointing up
ACS[ULCORNER]=${altchar[l]:-+} # upper left corner
ACS[URCORNER]=${altchar[k]:-+} # upper right corner
ACS[VLINE]=${altchar[x]:-#} # vertical line
ACS[TEST]=${altchar[n]:-#}



PROMPT="\
${PR_STUFF[SET_CHARSET]}\
${PR_STUFF[CYAN]}${PR_STUFF[SHIFT_IN]}\
${ACS[ULCORNER]}${PR_STUFF[SHIFT_OUT]}[${PR_STUFF[NO_COLOR]}%n@%m\
${PR_STUFF[CYAN]}]${PR_STUFF[SHIFT_IN]}\
${ACS[HLINE]}${PR_STUFF[SHIFT_OUT]}\
${PR_STUFF[SHIFT_OUT]}[${PR_STUFF[NO_COLOR]}%D{%H:%M}\
${PR_STUFF[CYAN]}]${PR_STUFF[SHIFT_IN]}\
${ACS[HLINE]}${PR_STUFF[SHIFT_OUT]}[${PR_STUFF[NO_COLOR]}%~\
${PR_STUFF[CYAN]}]${PR_STUFF[SHIFT_IN]}${ACS[HLINE]}\
${PR_STUFF[CYAN]}]${PR_STUFF[SHIFT_IN]}
${ACS[LLCORNER]}${ACS[HLINE]}${PR_STUFF[SHIFT_OUT]}> ${PR_STUFF[NO_COLOR]}"

unset RPROMPT


Re: Re: Re: zsh multiline prompt and windows lock problem

Monday, March 16, 2009 11:22 AM - Support

Hello JP,

We have duplicated the problem. Our developers are now looking at this problem. Please allow us a few days to get back to this post.

Thank you for your patience.



---
Technical Support


Did you know that Xshell and Xftp are free for home and school use? To find out more, please click here.


Re: Re: Re: zsh multiline prompt and windows lock problem

Tuesday, March 17, 2009 11:49 AM - Support

After a further testing, we found out that this problem is caused by zsh itself. You can see the same problem occuring under console or any other terminal emulators.

You will have to contact zsh developers to fix this problem.

Hope this helps.




---
Technical Support


Did you know that Xshell and Xftp are free for home and school use? To find out more, please click here.


Re: Re: Re: Re: zsh multiline prompt and windows lock problem

Wednesday, March 18, 2009 12:39 AM - JP

OK, thanks for your investigation, I'll try to get in touch with zsh team.


[SOLVED]Re: Re: Re: Re: Re: zsh multiline prompt and windows lock problem

Wednesday, March 18, 2009 3:32 AM - JP

Hello,

I have found the solution in the archive of zsh users mailing list.

In fact, it is linked to the way the terminal get resized, and how it handle it.

The solution is in fact pretty simple : the first line of the prompt can be printed in the precmd function with 'print -rP "..."' and the second line is set in PROMPT variable.

This is a workaround more than a real fix, but it's working.

Hopes it could help others, even if not totally xshell related.

Regards


Re: [SOLVED]Re: Re: Re: Re: Re: zsh multiline prompt and windows lock problem

Wednesday, March 18, 2009 10:54 AM - Support

Thank you for sharing this information.

Please let us know if you have any other questions.



Previous views: 366