Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: What was the reason for history -D not reporting runtimes?
- X-seq: zsh-users 11045
- From: "Nikolai Weibull" <now@xxxxxxxx>
- To: "zsh-users@xxxxxxxxxx" <zsh-users@xxxxxxxxxx>
- Subject: Re: What was the reason for history -D not reporting runtimes?
- Date: Mon, 27 Nov 2006 19:55:13 +0100
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=uG3Q01bLsrCDn8ssFO3NV5dItOqIxdHbNi1mlSZ5qv5xDRzyf5uuO04QUKxezF1UkzT7QUWVHzbRazBETDdzkIculOfVK+xIr9cruE4PJ0d4wZIQ2rRfa+6SZBusC6TEgMTc0PdYdiemvg2eO9o+Bf2+EtWSHOfTDM8tDCoSYwM=
- In-reply-to: <dbfc82860611240516w403e14fes7ef5a8d29148512c@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <dbfc82860611240516w403e14fes7ef5a8d29148512c@xxxxxxxxxxxxxx>
- Sender: nikolai.weibull@xxxxxxxxx
On 11/24/06, Nikolai Weibull <now@xxxxxxxx> wrote:
I have a vague memory of asking this question earlier, but I couldn't
find it in any of the archives and not in my own mail-archive either,
so here it goes (again, probably):
Why does history -D not report times correctly, only giving 0:00?
Ah, I found the culprit. I use Bart's version of preexec for setting
the title inside screen. It seems that using the z expansion flag in
cmd=${(z)1}) messes up the time-tracking code somehow.
This is what I have
_set_title () {
[[ $LOCKTITLE == 1 ]] && return
case $TERM in
(screen*)
print -nR $'\ek'${1[1,18]}$'\e\\' ;;
esac
return 0
}
precmd () {
_set_title zsh
}
preexec () {
local -a cmd
cmd=(${(z)1})
case $cmd[1] in
(fg)
if (( $#cmd == 1 )); then
cmd=(builtin jobs -l %+)
else
cmd=(builtin jobs -l ${(Q)cmd[2]})
fi ;;
(r)
cmd=($(builtin history -n -1))
_set_title $cmd[1]:t
return ;;
(%*)
cmd=(builtin jobs -l ${(Q)cmd[1]}) ;;
(exec)
shift cmd ;&
(*)
_set_title $cmd[1]:t
return ;;
esac
local -A jt
jt=(${(kv)jobtexts})
$cmd >>(read num rest
cmd=(${(z)${(e):-\$jt$num}})
_set_title $cmd[1]:t) 2>/dev/null
}
I'm unable to determine why this breaks. If I substitute ${=1} for
the expansion, it still breaks as soon as it gets to printing in
_set_title.
nikolai
Messages sorted by:
Reverse Date,
Date,
Thread,
Author