users/8219: add $HISTCMD

This commit is contained in:
Peter Stephenson 2004-11-16 19:05:50 +00:00
parent fece5e8960
commit ba32e52292
4 changed files with 17 additions and 1 deletions

View file

@ -1,5 +1,11 @@
2004-11-16 Peter Stephenson <pws@csr.com> 2004-11-16 Peter Stephenson <pws@csr.com>
* users/8219: Doc/Zsh/params.yo, Doc/Zsh/zle.yo,
Src/params.c: Add $HISTCMD which gives the current history
line number as in bash. Works like ${(%):-%!} except that a human
being could find out how to use it, too. Note it is
distinct from zle's $HISTNO.
* 20556: AIX 5.3 has a SOCKLEN_T definition, so use * 20556: AIX 5.3 has a SOCKLEN_T definition, so use
ZSOCKLEN_T internally. ZSOCKLEN_T internally.

View file

@ -535,6 +535,12 @@ parameter. Also (assuming sufficient privileges), you may start a single
command under a different command under a different
group ID by `tt(LPAR()GID=)var(gid)tt(; command+RPAR())' group ID by `tt(LPAR()GID=)var(gid)tt(; command+RPAR())'
) )
vindex(HISTCMD)
item(tt(HISTCMD))(
The current history line number in an interactive shell, in other
words the line number for the command that caused tt($HISTCMD)
to be read.
)
vindex(HOST) vindex(HOST)
item(tt(HOST))( item(tt(HOST))(
The current hostname. The current hostname.

View file

@ -645,7 +645,10 @@ item(tt(HISTNO) (integer))(
The current history number. Setting this has the same effect as The current history number. Setting this has the same effect as
moving up or down in the history to the corresponding history line. moving up or down in the history to the corresponding history line.
An attempt to set it is ignored if the line is not stored in the An attempt to set it is ignored if the line is not stored in the
history. history. Note this is not the same as the parameter tt(HISTCMD),
which always gives the number of the history line being added to the main
shell's history. tt(HISTNO) refers to the line being retrieved within
zle.
) )
vindex(KEYMAP) vindex(KEYMAP)
item(tt(KEYMAP) (scalar))( item(tt(KEYMAP) (scalar))(

View file

@ -184,6 +184,7 @@ LCIPDEF("LC_TIME"),
IPDEF4("!", &lastpid), IPDEF4("!", &lastpid),
IPDEF4("$", &mypid), IPDEF4("$", &mypid),
IPDEF4("?", &lastval), IPDEF4("?", &lastval),
IPDEF4("HISTCMD", &curhist),
IPDEF4("LINENO", &lineno), IPDEF4("LINENO", &lineno),
IPDEF4("PPID", &ppid), IPDEF4("PPID", &ppid),