diff --git a/ChangeLog b/ChangeLog index 41635f6ff..24d7a4db1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2001-11-02 Oliver Kiddle + * unposted: Functions/Prompts/prompt_oliver_setup, + Doc/Zsh/prompt.yo: documentation and example for 16198 + + * 16198: Src/prompt.c: add %j prompt expansion and j test + character for putting the number of jobs in the prompt + * 16177: Completion/Unix/Type/_time_zone: also look in /usr/lib/locale/TZ for time zones diff --git a/Doc/Zsh/prompt.yo b/Doc/Zsh/prompt.yo index a62418277..cb4609240 100644 --- a/Doc/Zsh/prompt.yo +++ b/Doc/Zsh/prompt.yo @@ -111,6 +111,9 @@ The line number currently being executed in the script, sourced file, or shell function given by tt(%N). This is most useful for debugging as part of tt($PS4). ) +item(tt(%j))( +The number of jobs. +) item(tt(%L))( The current value of tt($SHLVL). ) @@ -222,6 +225,7 @@ least var(n) elements.) sitem(tt(D))(True if the month is equal to var(n) (January = 0).) sitem(tt(d))(True if the day of the month is equal to var(n).) sitem(tt(g))(True if the effective gid of the current process is var(n).) +sitem(tt(j))(True if the number of jobs is at least var(n).) sitem(tt(L))(True if the tt(SHLVL) parameter is at least var(n).) sitem(tt(l))(True if at least var(n) characters have already been printed on the current line.) diff --git a/Functions/Prompts/prompt_oliver_setup b/Functions/Prompts/prompt_oliver_setup index 1f4e598fc..c4a28b705 100644 --- a/Functions/Prompts/prompt_oliver_setup +++ b/Functions/Prompts/prompt_oliver_setup @@ -1,35 +1,41 @@ # oliver prompt theme prompt_oliver_help() { - cat - <= arg) + test = 1; + break; case 'l': *bp = '\0'; countprompt(bufline, &t0, 0, 0); @@ -371,6 +378,14 @@ putpromptchar(int doprint, int endchar) sprintf(bp, "%d", curhist); bp += strlen(bp); break; + case 'j': + for (numjobs = 0, j = 1; j < MAXJOB; j++) + if (jobtab[j].stat && jobtab[j].procs && + !(jobtab[j].stat & STAT_NOPRINT)) numjobs++; + addbufspc(DIGBUFSIZE); + sprintf(bp, "%d", numjobs); + bp += strlen(bp); + break; case 'M': queue_signals(); if ((hostnam = getsparam("HOST")))