1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-27 04:40:59 +01:00

33057: %e in prompts shows evaluation / execution depth

This commit is contained in:
Peter Stephenson 2014-08-29 09:46:34 +01:00
parent 40d559d880
commit 711e1427b5
3 changed files with 24 additions and 0 deletions

View file

@ -786,6 +786,19 @@ putpromptchar(int doprint, int endchar, unsigned int *txtchangep)
if(bv->Rstring)
stradd(bv->Rstring);
break;
case 'e':
{
int depth = 0;
Funcstack fsptr = funcstack;
while (fsptr) {
depth++;
fsptr = fsptr->prev;
}
addbufspc(DIGBUFSIZE);
sprintf(bv->bp, "%d", depth);
bv->bp += strlen(bv->bp);
break;
}
case 'I':
if (funcstack && funcstack->tp != FS_SOURCE &&
!IN_EVAL_TRAP()) {