about summary refs log tree commit diff
path: root/Doc/Zsh/prompt.yo
diff options
context:
space:
mode:
authordana <dana@dana.is>2018-06-20 17:29:56 -0500
committerdana <dana@dana.is>2018-06-20 17:29:56 -0500
commit394f3a47e464b67b17e2cb7166df066829250e88 (patch)
tree0fe4262c7857d546878f64b53fc2813e6f59296b /Doc/Zsh/prompt.yo
parenteada7e1138a3fca90f085dd764ad86098e58c9ac (diff)
downloadzsh-394f3a47e464b67b17e2cb7166df066829250e88.tar.gz
zsh-394f3a47e464b67b17e2cb7166df066829250e88.tar.xz
zsh-394f3a47e464b67b17e2cb7166df066829250e88.zip
43075: Support nanosecond-precision time formatting
* Teach ztrftime() %9. and %N for nanoseconds
* Update prompt expansion to pass sub-second times for time formatting
* Update zsh/stat to pass sub-second times for atime/mtime/ctime

Patch heavily based on Oliver's earlier work @ workers/24059
Diffstat (limited to 'Doc/Zsh/prompt.yo')
-rw-r--r--Doc/Zsh/prompt.yo12
1 files changed, 8 insertions, 4 deletions
diff --git a/Doc/Zsh/prompt.yo b/Doc/Zsh/prompt.yo
index 3c8f2a094..909012c8e 100644
--- a/Doc/Zsh/prompt.yo
+++ b/Doc/Zsh/prompt.yo
@@ -198,11 +198,15 @@ endsitem()
 In addition, if the system supports the POSIX tt(gettimeofday) system
 call, tt(%.) provides decimal fractions of a second since the epoch with
 leading zeroes.  By default three decimal places are provided, but a
-number of digits up to 6 may be given following the tt(%); hence tt(%6.)
-outputs microseconds.  A typical example of this is the format
-`tt(%D{%H:%M:%S.%.})'.
+number of digits up to 9 may be given following the tt(%); hence tt(%6.)
+outputs microseconds, and tt(%9.) outputs nanoseconds.  (The latter
+requires a nanosecond-precision tt(clock_gettime); systems lacking this
+will return a value multiplied by the appropriate power of 10.)  A typical
+example of this is the format `tt(%D{%H:%M:%S.%.})'.
 
-The GNU extension that a `tt(-)' between the tt(%) and the
+The GNU extension tt(%N) is handled as a synonym for tt(%9.).
+
+Additionally, the GNU extension that a `tt(-)' between the tt(%) and the
 format character causes a leading zero or space to be stripped
 is handled directly by the shell for the format characters tt(d), tt(f),
 tt(H), tt(k), tt(l), tt(m), tt(M), tt(S) and tt(y); any other format