zsh-workers
 help / color / mirror / code / Atom feed
* fc -l doesn't match %h number?
@ 2008-10-01 15:54 Rocky Bernstein
  2008-10-02  6:21 ` Bart Schaefer
  2008-10-06 18:10 ` Peter Stephenson
  0 siblings, 2 replies; 5+ messages in thread
From: Rocky Bernstein @ 2008-10-01 15:54 UTC (permalink / raw)
  To: Zsh hackers list

It looks to me like "fc -l" is not showing a command in the history
that %h is counting when one enters a new subshell.
Consider this program:

#==============================
fc -ap /tmp/hist 10 10
hook() {
    line=''
    fc -l 2>/dev/null
    print subshell level: $ZSH_SUBSHELL
    print $ZSH_DEBUG_CMD
    vared -e -h -p 'hist<%h> ' line
    [[ $line == 'q' ]] && exit
    print -s -- "$line"
}

trap 'hook' DEBUG
x=2
( x=3;
  y=4
)
x=5
#==============================

Now let's run:
$ zsh fc.sh

subshell level: 0
x=2
hist<1> a

    1  a
subshell level: 0
(
	x=3
	y=4
)
hist<2> b

    1  a
subshell level: 1
x=3
hist<3>
# ...


Notice that the numbers in angle brackets keep increasing <1>, <2>,
<3> as they should. However above "hist<3>" we just see "1  a" listed
and not "b".

Am I doing something wrong? Thought's about what's going on here?

Thanks.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-10-09  1:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-01 15:54 fc -l doesn't match %h number? Rocky Bernstein
2008-10-02  6:21 ` Bart Schaefer
2008-10-02  8:38   ` Rocky Bernstein
2008-10-06 18:10 ` Peter Stephenson
2008-10-09  1:18   ` Rocky Bernstein

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).