zsh-workers
 help / color / mirror / code / Atom feed
* history file re-writing in sub-shell
@ 1995-09-07 19:26 Yoshiaki KASAHARA
  1995-09-07 20:03 ` Zoltan Hidvegi
  0 siblings, 1 reply; 3+ messages in thread
From: Yoshiaki KASAHARA @ 1995-09-07 19:26 UTC (permalink / raw)
  To: zsh-workers

Hello.  I'm not a subscriber of this list, but I found a weirdness
while using zsh-2.6-beta8 and 10, so I'll report it here.

After I replaced my zsh from 2.5 to 2.6beta, I found that saved
history was not read correctly.

Finally I found that when I use $(non-zsh-builtin-command), the
content of $HISTFILE is changed (just like when an interactive shell
exits).  I believe there are something wrong with command
substitution...  I have never encountered such a problem with zsh 2.5.

Please send me responses (if any).  Thank you.
--
Yoshiaki KASAHARA
Dept. of Comp. Sci. and Comm. Eng., Kyushu Univ., Fukuoka, Japan


The output of Util/reporter

# START zsh saveset
# uname:  SunOS biyo 4.1.4 1 sun4m

# Aliases.

alias ,='\'cd -\''
alias ..='\'cd ..\''
alias 24='\'stty rows 24\''
alias 25='\'stty rows 25\''
alias 30='\'stty rows 30\''
alias 31='\'stty rows 31\''
alias 98='\'localcap;export TERM=pc9801-ms\''
alias Phone='\'phone -ca\''
alias ascii='\'echo -n \'\\'\'\e(B\'\\''
alias asciitex='\'. ~/.zenviron-ascii && echo setup for ascii TeX.\''
alias bc='\'bc ~/.bc\''
alias cftp='\'ncftp `basename $PWD`\''
alias cp='\'cp -i\''
alias dirs='\'dirs -v\''
alias freset='\'echo -n \'\\'\'\ec\'\\''
alias h='history'
alias jis='\'echo -n \'\\'\'\e(J\'\\''
alias la='\'ls -a\''
alias lal='\'ls -lga\''
alias lascii='\'export LESSCHARSET=ascii\''
alias lkanji='\'export LESSCHARSET=japanese-euc\''
alias ll='\'ls -lg\''
alias lo='exit'
alias localcap='\'export TERMCAP=~/etc/termcap\''
alias lr='\'ls -R\''
alias ls='\'ls -F\''
alias lss='\'ls -s\''
alias lt='\'ls -t\''
alias more='less'
alias mv='\'mv -i\''
alias ntttex='\'. ~/.zenviron-ntt && echo setup for NTT TeX.\''
alias nv='\'echo -n \'\\'\'\e[?5l\'\\''
alias pd='popd'
alias phone='\'phone -ce\''
alias prexs='\'settermcap;xs\''
alias reso='\'. ~/.zaliases\''
alias rm='\'rm -i\''
alias rmap='\'rmap -HJ -ce\''
alias run-help='man'
alias rv='\'echo -n \'\\'\'\e[?5h\'\\''
alias sd='pushd'
alias settermcap='\'set noglob;eval `tset -Q -s -I`\''
alias shown='\'show -noshowproc\''
alias so='source'
alias vt100='\'export TERM=vt100\''
alias which-command='whence'
alias xs='\'set noglob; eval `resize`\''
alias xsd='/usr/local/X11/bin/sd'

# Key bindings.

bindkey -r "^@"
bindkey -r "^A"
bindkey -r "^B"
bindkey -r "^C"
bindkey -r "^D"
bindkey -r "^E"
bindkey -r "^F"
bindkey -r "^G"
bindkey -r "^H"
bindkey -r "^I"
bindkey -r "^J"
bindkey -r "^K"
bindkey -r "^L"
bindkey -r "^M"
bindkey -r "^N"
bindkey -r "^O"
bindkey -r "^P"
bindkey -r "^Q"
bindkey -r "^R"
bindkey -r "^S"
bindkey -r "^T"
bindkey -r "^U"
bindkey -r "^V"
bindkey -r "^W"
bindkey -r "^X"
bindkey -r "^Y"
bindkey -r "^Z"
bindkey -r "\e"
bindkey -r "^_"
bindkey -r " "
bindkey -r "^?"
bindkey -r "^X^B"
bindkey -r "^X^F"
bindkey -r "^X^J"
bindkey -r "^X^K"
bindkey -r "^X^N"
bindkey -r "^X^O"
bindkey -r "^X^U"
bindkey -r "^X^V"
bindkey -r "^X^X"
bindkey -r "^X*"
bindkey -r "^XG"
bindkey -r "^Xg"
bindkey -r "^Xr"
bindkey -r "^Xs"
bindkey -r "^Xu"
bindkey -r "\e^D"
bindkey -r "\e^G"
bindkey -r "\e^H"
bindkey -r "\e^I"
bindkey -r "\e^J"
bindkey -r "\e^L"
bindkey -r "\e^M"
bindkey -r "\e^_"
bindkey -r "\e "
bindkey -r "\e!"
bindkey -r "\e\""
bindkey -r "\e$"
bindkey -r "\e'"
bindkey -r "\e-"
bindkey -r "\e."
bindkey -r "\e0"
bindkey -r "\e1"
bindkey -r "\e2"
bindkey -r "\e3"
bindkey -r "\e4"
bindkey -r "\e5"
bindkey -r "\e6"
bindkey -r "\e7"
bindkey -r "\e8"
bindkey -r "\e9"
bindkey -r "\e<"
bindkey -r "\e>"
bindkey -r "\e?"
bindkey -r "\eA"
bindkey -r "\eB"
bindkey -r "\eC"
bindkey -r "\eD"
bindkey -r "\eF"
bindkey -r "\eG"
bindkey -r "\eH"
bindkey -r "\eL"
bindkey -r "\eN"
bindkey -r "\eP"
bindkey -r "\eQ"
bindkey -r "\eR"
bindkey -r "\eS"
bindkey -r "\eT"
bindkey -r "\eU"
bindkey -r "\eW"
bindkey -r "\e[A"
bindkey -r "\e[B"
bindkey -r "\e[C"
bindkey -r "\e[D"
bindkey -r "\e_"
bindkey -r "\ea"
bindkey -r "\eb"
bindkey -r "\ec"
bindkey -r "\ed"
bindkey -r "\ef"
bindkey -r "\eg"
bindkey -r "\eh"
bindkey -r "\el"
bindkey -r "\en"
bindkey -r "\ep"
bindkey -r "\eq"
bindkey -r "\er"
bindkey -r "\es"
bindkey -r "\et"
bindkey -r "\eu"
bindkey -r "\ew"
bindkey -r "\ex"
bindkey -r "\ey"
bindkey -r "\ez"
bindkey -r "\e|"
bindkey -r "\e^?"

bindkey "^@"	set-mark-command
bindkey "^A"	beginning-of-line
bindkey "^B"	backward-char
bindkey "^C"	send-break
bindkey "^D"	delete-char-or-list
bindkey "^E"	end-of-line
bindkey "^F"	forward-char
bindkey "^G"	list-expand
bindkey "^H"	backward-delete-char
bindkey "^I"	expand-or-complete
bindkey "^J"	accept-line
bindkey "^K"	kill-line
bindkey "^L"	clear-screen
bindkey "^M"	accept-line
bindkey "^N"	down-line-or-search
bindkey "^O"	accept-line-and-down-history
bindkey "^P"	up-line-or-search
bindkey "^Q"	push-input
bindkey "^R"	history-incremental-search-backward
bindkey "^S"	history-incremental-search-forward
bindkey "^T"	transpose-chars
bindkey "^U"	kill-whole-line
bindkey "^V"	quoted-insert
bindkey "^W"	kill-region
bindkey "^X"	prefix
bindkey "^Y"	yank
bindkey "^Z"	undefined-key
bindkey "\e"	prefix
bindkey "^_"	undo
bindkey " "	magic-space
bindkey "^?"	backward-delete-char
bindkey "^X^B"	vi-match-bracket
bindkey "^X^F"	vi-find-next-char
bindkey "^X^J"	vi-join
bindkey "^X^K"	kill-buffer
bindkey "^X^N"	infer-next-history
bindkey "^X^O"	overwrite-mode
bindkey "^X^U"	undo
bindkey "^X^V"	vi-cmd-mode
bindkey "^X^X"	exchange-point-and-mark
bindkey "^X*"	expand-word
bindkey "^XG"	list-expand
bindkey "^Xg"	list-expand
bindkey "^Xr"	history-incremental-search-backward
bindkey "^Xs"	history-incremental-search-forward
bindkey "^Xu"	undo
bindkey "\e^D"	list-choices
bindkey "\e^G"	send-break
bindkey "\e^H"	backward-kill-word
bindkey "\e^I"	self-insert-unmeta
bindkey "\e^J"	self-insert-unmeta
bindkey "\e^L"	clear-screen
bindkey "\e^M"	self-insert-unmeta
bindkey "\e^_"	copy-prev-word
bindkey "\e "	expand-history
bindkey "\e!"	expand-history
bindkey "\e\""	quote-region
bindkey "\e$"	spell-word
bindkey "\e'"	quote-line
bindkey "\e-"	neg-argument
bindkey "\e."	insert-last-word
bindkey "\e0"	digit-argument
bindkey "\e1"	digit-argument
bindkey "\e2"	digit-argument
bindkey "\e3"	digit-argument
bindkey "\e4"	digit-argument
bindkey "\e5"	digit-argument
bindkey "\e6"	digit-argument
bindkey "\e7"	digit-argument
bindkey "\e8"	digit-argument
bindkey "\e9"	digit-argument
bindkey "\e<"	beginning-of-buffer-or-history
bindkey "\e>"	end-of-buffer-or-history
bindkey "\e?"	which-command
bindkey "\eA"	accept-and-hold
bindkey "\eB"	backward-word
bindkey "\eC"	capitalize-word
bindkey "\eD"	kill-word
bindkey "\eF"	forward-word
bindkey "\eG"	get-line
bindkey "\eH"	run-help
bindkey "\eL"	down-case-word
bindkey "\eN"	history-search-forward
bindkey "\eP"	history-search-backward
bindkey "\eQ"	push-line
bindkey "\eR"	toggle-literal-history
bindkey "\eS"	spell-word
bindkey "\eT"	transpose-words
bindkey "\eU"	up-case-word
bindkey "\eW"	copy-region-as-kill
bindkey "\e[A"	up-line-or-history
bindkey "\e[B"	down-line-or-history
bindkey "\e[C"	forward-char
bindkey "\e[D"	backward-char
bindkey "\e_"	insert-last-word
bindkey "\ea"	accept-and-hold
bindkey "\eb"	backward-word
bindkey "\ec"	capitalize-word
bindkey "\ed"	kill-word
bindkey "\ef"	forward-word
bindkey "\eg"	get-line
bindkey "\eh"	run-help
bindkey "\el"	down-case-word
bindkey "\en"	history-search-forward
bindkey "\ep"	history-search-backward
bindkey "\eq"	push-line
bindkey "\er"	toggle-literal-history
bindkey "\es"	spell-word
bindkey "\et"	transpose-words
bindkey "\eu"	up-case-word
bindkey "\ew"	copy-region-as-kill
bindkey "\ex"	execute-named-cmd
bindkey "\ey"	yank-pop
bindkey "\ez"	execute-last-named-cmd
bindkey "\e|"	vi-goto-column
bindkey "\e^?"	backward-kill-word

# Completions.

awk: syntax error near line 2
awk: illegal statement near line 2
awk: syntax error near line 5
awk: illegal statement near line 5
awk: syntax error near line 9
awk: illegal statement near line 9
awk: syntax error near line 12
awk: illegal statement near line 12

# Undefined functions.


# Defined functions.

chpwd () {
	echo -n "\\e]2;${WinNum}:${WinName}@${HOST} : $PWD\\007"
}
dic () {
	/usr/local/cslabs/bin/dic $* | less
}
mman () {
	nroff -man $* | less -s
}

# Limits.

limit stacksize       8MB
limit descriptors     256

# Non-array variables.

TERMCAP='/u/kasahara/etc/termcap'
TERM='kterm'
ADA_INCLUDE_PATH="/home/public/gnat/adainclude"
ADA_OBJECTS_PATH="/home/public/gnat/lib/gcc-lib/sparc-sun-sunos4.1.3/2.6.2/adalib"
ANGBAND_X11_FONT="hackmap16"
ANGBAND_X11_FONT_CHOICE="a14"
ANGBAND_X11_FONT_RECALL="a14"
ARGC="0"
AUDIO="enable"
AUDIOFILE="biyo:0.0"
BAUD="9600"
BIBINPUTS=".:/u/kasahara/tex/bibfiles"
CDPATH=""
COLUMNS="80"
COMPLETE="YES"
C_INCLUDE_PATH="/home/public/gnat/lib/gcc-lib/sparc-sun-sunos4.1.3/2.6.2/include"
DIRSTACKSIZE="20"
DISPLAY="biyo:0.0"
EDITOR="vi"
EGID="700"
ERRNO="9"
ESHELL="/bin/csh"
EUID="7039"
FCEDIT="vi"
FIGNORE=""
FPATH="/u/kasahara/lib/zsh/func:/usr/local/lib/zsh/func"
FSP_DELAY="10000"
FSP_TIMEOUT="10"
FSP_TRACE=""
GCC_EXEC_PREFIX="/home/public/gnat/lib/gcc-lib/sparc-sun-sunos4.1.3/2.6.2/"
GID="700"
GNU_PORT="28529"
GWMPATH="/u/kasahara/lib/gwm:/usr/local/X11/lib/X11/gwm"
HACKOPTIONS="time"
HELPDIR="/usr/local/lib/zsh/help"
HISTFILE="/u/kasahara/.zhistory"
HISTSIZE="500"
HOME="/u/kasahara"
HOST="biyo"
HOSTTYPE="sunos4.1.3_U1"
HTYPE="sun4"
IRCNICK="Rin"
IRCSERVER="irc.karrn.ad.jp"
JNAMES="/u/kasahara/.jnames"
JSERVER="wnnsvr"
KEYTIMEOUT="40"
LANG="ja_JP.ujis"
LESS="-i"
LIBRARY_PATH="/home/public/gnat/lib/gcc-lib/sparc-sun-sunos4.1.3/2.6.2/adalib"
LINENO="354"
LINES="24"
LISTMAX="0"
LITHISTSIZE="5"
LOGCHECK="1"
LOGNAME="kasahara"
MACHTYPE="sparc"
MAIL="/usr/spool/mail/kasahara"
MAILCHECK="60"
MAILPATH=""
MANPATH="/u/kasahara/man:/usr/X11R5/man:/usr/local/X11/man:/usr/local/lib/mh-6.8.3/man:/usr/local/man:/usr/man:/usr/local/AdaEd/man:/usr/local/lib/sr/man:/usr/local/fsp/man"
MM_CHARSET="ISO-2022-JP"
MORIA_SAV="/u/kasahara/etc/moria.save"
NETHACKOPTIONS="autopickup,nosilent,time,name:RinginBell,catname:KURO,showexp,lit_corridor,checkpoint,tombstone,fruit:Sunkist30,pettype:cat,hilite_pet,pickup_types:$"
NNTPSERVER="mitsuze"
NULLCMD="cat"
OLDPWD="/u/kazunori/install/zsh-2.6-beta10"
OPTARG=""
OPTIND="1"
OS="SunOS4"
OSNAME="SunOS 4.1.4"
OSTYPE="sunos4.1.3_U1"
PAGER="less -s"
PATH="/u/kasahara/bin:/u/kasahara/bin/sun4:/usr/local/cslabs/bin:/usr/local/cslabs/bin/sun4:/home/public/gnat/bin:/usr/local/ascii_tex/bin:/usr/local/bin/ispell-3.1.18:/usr/local/bin:/usr/local/X11/bin:/usr/bin/X11:/usr/local/bin/X11:/usr/X11/bin:/usr/X11R6/bin:/usr/local/bin/AF:/usr/local/bin/ImageMagick:/usr/local/bin/Canna:/usr/local/AdaEd/bin:/usr/ucb:/usr/bin:/bin:/usr/kvm:/usr/local/etc:/usr/etc:/usr/games:/usr/local/games:/usr/demo:/usr/local/games/blast:/usr/local/bin/sr:/usr/local/bin/mh:/usr/local/bin/metamail:/usr/local/fsp/bin:/usr/5bin:/usr/openwin/bin:/usr/hosts"
PERIOD="0"
PGPPATH="/u/kasahara/.pgp"
POSTEDIT=""
PPID="13769"
PROMPT="%S%h%s%n@%m<%l>[%T] %c %# "
PROMPT2="> "
PROMPT3="?# "
PROMPT4="+ "
PS1="%S%h%s%n@%m<%l>[%T] %c %# "
PS2="> "
PS3="?# "
PS4="+ "
PSPRINTER="pclsr"
PSVAR=""
PWD="/u/kazunori/install/zsh-2.6-beta10/Util"
RANDOM="26773"
READNULLCMD="more"
REPORTTIME="-1"
RPROMPT=" %~"
RPS1=" %~"
SAVEHIST="250"
SECONDS="63"
SHELL="/usr/local/bin/zsh"
SHLVL="2"
SOUND_PATH=".:/u/kasahara/lib/voice:/u/kasahara/lib/voice/falcon3:/u/kasahara/lib/voice/xwing:blast:/u/kasahara/lib/voice/xwing/sfx:/u/kasahara/lib/voice/xwing/speech:/u/kasahara/lib/voice/tie/tiesfx:/u/kasahara/lib/voice/tie/sfxblast"
SPROMPT="zsh: correct \`%R\' to \`%r\' [nyae]? "
TAPE="/dev/nrst1"
TERMINFO="/u/kasahara/.terminfo"
TEXFONTS=".:/usr/tex/fonts/tfm/cmfonts:/usr/tex/fonts/tfm/LaTeXfonts:/usr/tex/fonts/tfm/utilityfonts:/usr/tex/fonts/tfm/amsfonts:/usr/local/ascii_tex/jfms:/usr/tex/fonts/tfm/cslabs:/usr/tex/fonts/tfm/mufonts"
TEXINPUTS=".:/u/kasahara/TeX/sty:/usr/local/LaTeXstyles:/usr/local/ascii_tex/jmacros:/usr/local/ascii_tex/macros"
TIMEFMT="%J  %U user %S system %P cpu %*E total"
TMOUT="0"
TMPPREFIX="/tmp/zsh"
TTY="/dev/ttyp3"
TZNAME="JST"
UID="7039"
USER="kasahara"
USERNAME="kasahara"
VENDOR="sun"
VISUAL="vi"
WATCH="all"
WATCHFMT="%n has %a %l from %(m:%m:local) at %T %w."
WINDOWID="29360143"
WORDCHARS="*?_-.[]~=/&;!#$%^(){}<>"
WinEntry="29360143  (0:kterm@biyo : /u/kazunori)"
WinName="kterm"
WinNum="0"
XDVIFONTS=".:/usr/tex/fonts/240pk/LaTeXfonts:/usr/tex/fonts/240pk/amsfonts:/usr/tex/fonts/240pk/cmfonts:/usr/tex/fonts/240pk/cslabs:/usr/tex/fonts/240pk/mufonts:/usr/local/ascii_tex.1.13/jfms"
XMODIFIERS="@im=_XWNMO"
XNLSPATH="/usr/local/X11/lib/X11/nls"
ZSH="2.6-beta10"
ZSH_NAME="zsh-2.6-beta10"
ZSH_VERSION="2.6-beta10"
each="unix"
histchars="!^#"
pat="-beta10"
rel="6"
reporter_junkiequotes="no"
rev="2"
status="0"
str="SunOS biyo 4.1.4 1 sun4m"
prompt='test%'

# Array variables.

argv=()
cdpath=()
fignore=()
folders=(Article News News/alt.binaries.doom News/alt.binaries.pictures.anime News/alt.binaries.sounds.d News/alt.binaries.sounds.mods News/alt.games.apogee News/alt.games.descent News/alt.games.doom News/alt.games.doom.announce News/alt.games.doom.newplayers News/alt.games.omega News/alt.games.xpilot News/alt.japanese.text News/alt.sources News/alt.sources.wanted News/comp.answers News/comp.lang.ada News/comp.lang.perl News/comp.lang.perl.announce News/comp.mail.mh News/comp.mail.misc News/comp.mail.sendmail News/comp.os.linux.announce News/comp.software.testing News/comp.sources.d News/comp.sources.games News/comp.sources.games.bugs News/comp.sources.x News/comp.sys.ibm.pc.demos News/comp.sys.ibm.pc.games.action News/comp.sys.ibm.pc.games.announce News/comp.sys.ibm.pc.games.flight-sim News/comp.sys.ibm.pc.hardware.video News/comp.sys.ibm.pc.soundcard News/comp.sys.ibm.pc.soundcard.advocacy News/comp.sys.ibm.pc.soundcard.games News/comp.sys.ibm.pc.soundcard.misc News/comp.s!
 ys.ibm.pc.soundcard.music News/com
fpath=(/u/kasahara/lib/zsh/func /usr/local/lib/zsh/func)
ftphosts=(ajpo.sei.cmu.edu ames.arc.nasa.gov archive.epas.utoronto.ca archive.orst.edu arizona.edu brains.cc.rl.ac.uk cactus.org etlport.etl.go.jp ftp.ascii.co.jp ftp.cco.caltech.edu ftp.cdrom.com ftp.center.osaka-u.ac.jp ftp.cica.indiana.edu ftp.cis.ksu.edu ftp.comlab.ox.ac.uk ftp.cs.ruu.nl ftp.cs.uit.no ftp.cs.unm.edu ftp.earthlink.net ftp.eng.ufl.edu ftp.geophys.hokudai.ac.jp ftp.gmd.de ftp.ieice.or.jp ftp.iij.ad.jp ftp.iup.edu ftp.kddlabs.co.jp ftp.krl.caltech.edu ftp.kuis.kyoto-u.ac.jp ftp.luth.se ftp.math.psu.edu ftp.mcs.kent.edu ftp.mei.co.jp ftp.netcom.com ftp.oita-u.ac.jp ftp.rahul.net ftp.sigmath.es.osaka-u.ac.jp ftp.uml.edu ftp.uu.net ftp.uwp.edu ftp.wwa.com garbo.uwasa.fi hydro.iis.u-tokyo.ac.jp ics.uci.edu infant2.sphs.indiana.edu jawbox.pc.cc.cmu.edu krakatoa.jsc.nasa.gov linc.cis.upenn.edu louie.udel.edu math.mps.ohio-state.edu neon.rain.com netcom.com netcom2.netcom.com nic.funet.fi oak.oakland.edu pubinfo.jpl.nasa.gov qdeck.com rambus.com risc.ua.edu romulus!
 .ulowell.edu rtfm.mit.edu skk.toho
mailpath=()
manpath=(/u/kasahara/man /usr/X11R5/man /usr/local/X11/man /usr/local/lib/mh-6.8.3/man /usr/local/man /usr/man /usr/local/AdaEd/man /usr/local/lib/sr/man /usr/local/fsp/man)
path=(/u/kasahara/bin /u/kasahara/bin/sun4 /usr/local/cslabs/bin /usr/local/cslabs/bin/sun4 /home/public/gnat/bin /usr/local/ascii_tex/bin /usr/local/bin/ispell-3.1.18 /usr/local/bin /usr/local/X11/bin /usr/bin/X11 /usr/local/bin/X11 /usr/X11/bin /usr/X11R6/bin /usr/local/bin/AF /usr/local/bin/ImageMagick /usr/local/bin/Canna /usr/local/AdaEd/bin /usr/ucb /usr/bin /bin /usr/kvm /usr/local/etc /usr/etc /usr/games /usr/local/games /usr/demo /usr/local/games/blast /usr/local/bin/sr /usr/local/bin/mh /usr/local/bin/metamail /usr/local/fsp/bin /usr/5bin /usr/openwin/bin /usr/hosts)
psvar=()
signals=(EXIT HUP INT QUIT ILL TRAP IOT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM URG STOP TSTP CONT CHLD TTIN TTOU IO XCPU XFSZ VTALRM PROF WINCH LOST USR1 USR2 ZERR DEBUG)
watch=(all)

# Exported variables.

export TERMCAP
export TERM
export ADA_INCLUDE_PATH
export ADA_OBJECTS_PATH
export ANGBAND_X11_FONT
export ANGBAND_X11_FONT_CHOICE
export ANGBAND_X11_FONT_RECALL
export AUDIO
export AUDIOFILE
export BIBINPUTS
export C_INCLUDE_PATH
export DISPLAY
export EDITOR
export ESHELL
export FPATH
export FSP_DELAY
export FSP_TIMEOUT
export FSP_TRACE
export GCC_EXEC_PREFIX
export GNU_PORT
export GWMPATH
export HACKOPTIONS
export HOME
export HTYPE
export IRCNICK
export IRCSERVER
export JNAMES
export JSERVER
export LANG
export LESS
export LIBRARY_PATH
export LOGNAME
export MANPATH
export MM_CHARSET
export MORIA_SAV
export NETHACKOPTIONS
export NNTPSERVER
export OS
export OSNAME
export PAGER
export PATH
export PGPPATH
export PSPRINTER
export PWD
export SHELL
export SHLVL
export SOUND_PATH
export TAPE
export TERM
export TERMINFO
export TEXFONTS
export TEXINPUTS
export TZNAME
export USER
export VISUAL
export WINDOWID
export WinName
export WinNum
export XDVIFONTS
export XMODIFIERS
export XNLSPATH

# Setopt.

setopt alwayslastprompt
setopt autoparamkeys
setopt autoremoveslash
setopt bgnice
setopt completeinword
setopt correct
setopt extendedhistory
setopt hashcmds
setopt hashdirs
setopt hashlistall
setopt histallowclobber
setopt histignoredups
setopt histnostore
setopt ignoreeof
setopt listambiguous
setopt listtypes
setopt longlistjobs
setopt noclobber
setopt noflowcontrol
setopt nohup
setopt notify
setopt numericglobsort
setopt printexitvalue
setopt pushdignoredups

# END zsh saveset


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

* Re: history file re-writing in sub-shell
  1995-09-07 19:26 history file re-writing in sub-shell Yoshiaki KASAHARA
@ 1995-09-07 20:03 ` Zoltan Hidvegi
  1995-09-08 16:29   ` P.Stephenson
  0 siblings, 1 reply; 3+ messages in thread
From: Zoltan Hidvegi @ 1995-09-07 20:03 UTC (permalink / raw)
  To: Yoshiaki KASAHARA; +Cc: zsh-workers

> 
> Hello.  I'm not a subscriber of this list, but I found a weirdness
> while using zsh-2.6-beta8 and 10, so I'll report it here.
> 
> After I replaced my zsh from 2.5 to 2.6beta, I found that saved
> history was not read correctly.
> 
> Finally I found that when I use $(non-zsh-builtin-command), the
> content of $HISTFILE is changed (just like when an interactive shell
> exits).  I believe there are something wrong with command
> substitution...  I have never encountered such a problem with zsh 2.5.
> 
> Please send me responses (if any).  Thank you.

I send a `fix' for that in article 337 some time ago, I send it again as noone
responded.  It fixes the problem but is completely disables saving history on
exec since an other bug I'm not going to fix (I have no time and I do not know
exec.c well enough).

Zoltan

>From hzoli Tue Aug 22 16:31:43 1995
Subject: HISTORY saving fixes
To: zsh-workers@math.gatech.edu (zsh-workers)

Zsh saves history on each command substitution.  I thought that this bug was
corrected long ago.

The patch below fixes this, and it also saves history when a builtin is
exec'ed.  It also disables history saving on exec in the startup files
(that's what Mark Borges complaind about a lot).  That's because zsh loads
the history file only after processing the startup files so saving it with
append_history unset would wipe out the history.  History saving is also
disabled in zexit for the same reason.

Unfortunately the exec part of this fix does not work as expected.  After
this patch zsh will never save anything on exec.  That is because subsh is
always true since entersubsh is called from exec.c near line 1241 for each
command or builtin executed with exec. This seems illogical for me but I do
not understand these things completely so I'd leave the fix to someone else.

The patch is for vanilla beta10.  For hzoli10.x the first hunk fails but it
can be merged easily by hand, and the really important part is the second
hunk.

Zoltan

*** Src/exec.c.~1~	Mon Aug 21 23:40:20 1995
--- Src/exec.c	Mon Aug 21 23:41:12 1995
***************
*** 1447,1454 ****
  		if (cmd->flags & CFLAG_EXEC) {
  		    if (subsh)
  			_exit(lastval);
! 		    else
! 			exit(lastval);
  		}
  		if (savelist) {
  		    /* Restore variables, freeing the list but not data. */
--- 1447,1456 ----
  		if (cmd->flags & CFLAG_EXEC) {
  		    if (subsh)
  			_exit(lastval);
! 		    if (unset(NORCS) && interact && sourcelevel < 32768)
! 			/* save the history file through execs */
! 			savehistfile(getsparam("HISTFILE"), 1, isset(APPENDHISTORY) ? 3 : 0);
! 		    exit(lastval);
  		}
  		if (savelist) {
  		    /* Restore variables, freeing the list but not data. */
***************
*** 1468,1474 ****
  	} else {
  	    if (cmd->flags & CFLAG_EXEC) {
  		setiparam("SHLVL", --shlvl);
! 		if (unset(NORCS) && interact)
  		    /* save the history file through execs */
  		    savehistfile(getsparam("HISTFILE"), 1, isset(APPENDHISTORY) ? 3 : 0);
  	    }
--- 1470,1476 ----
  	} else {
  	    if (cmd->flags & CFLAG_EXEC) {
  		setiparam("SHLVL", --shlvl);
! 		if (unset(NORCS) && interact && !subsh && sourcelevel < 32768)
  		    /* save the history file through execs */
  		    savehistfile(getsparam("HISTFILE"), 1, isset(APPENDHISTORY) ? 3 : 0);
  	    }
*** 1.28	1995/08/21 22:02:42
--- Src/builtin.c	1995/08/21 22:04:09
***************
*** 4829,4835 ****
  	    }
  	} else
  	    killrunjobs(); /* send SIGHUP to any jobs left running  */
!     if (unset(NORCS) && interact) {
  	if (isset(APPENDHISTORY))
  	    savehistfile(getsparam("HISTFILE"), 1, 3);
  	else
--- 4829,4835 ----
  	    }
  	} else
  	    killrunjobs(); /* send SIGHUP to any jobs left running  */
!     if (unset(NORCS) && interact && sourcelevel < 32768) {
  	if (isset(APPENDHISTORY))
  	    savehistfile(getsparam("HISTFILE"), 1, 3);
  	else


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

* Re: history file re-writing in sub-shell
  1995-09-07 20:03 ` Zoltan Hidvegi
@ 1995-09-08 16:29   ` P.Stephenson
  0 siblings, 0 replies; 3+ messages in thread
From: P.Stephenson @ 1995-09-08 16:29 UTC (permalink / raw)
  To: Zsh hackers list; +Cc: Yoshiaki KASAHARA

hzoli@cs.elte.hu wrote:
> > 
> > Hello.  I'm not a subscriber of this list, but I found a weirdness
> > while using zsh-2.6-beta8 and 10, so I'll report it here.
> > 
> > After I replaced my zsh from 2.5 to 2.6beta, I found that saved
> > history was not read correctly.
> > 
> > Finally I found that when I use $(non-zsh-builtin-command), the
> > content of $HISTFILE is changed (just like when an interactive shell
> > exits).  I believe there are something wrong with command
> > substitution...  I have never encountered such a problem with zsh 2.5.
> 
> I send a `fix' for that in article 337 some time ago, I send it
> again as noon e responded.  It fixes the problem but is completely
> disables saving history on exec since an other bug I'm not going to
> fix (I have no time and I do not know exec.c well enough).

Sorry, I meant to have a look at this but I've been busy too.

If you apply this after Zoltan's patch, it should restore the expected
behaviour.  It simply changes the flag for subshells (subsh) in the
case where it's not a true subshell but an exec about to happen.  I
can't see a problem with this and the obvious tests seem to work.

*** Src/exec.c~	Fri Sep  8 17:14:24 1995
--- Src/exec.c	Fri Sep  8 17:18:07 1995
***************
*** 1281,1286 ****
--- 1281,1287 ----
  	    holdintr();
      } else if ((cmd->flags & CFLAG_EXEC) && !nullexec) {
  	entersubsh(bkg, 1);
+ 	subsh = 2;		/* we're execing, not a true subshell */
      } else {
      /* Job is running in current shell. */
  	jobtab[thisjob].stat |= STAT_CURSH;
***************
*** 1502,1508 ****
  
  	    if (!forked) {
  		if (cmd->flags & CFLAG_EXEC) {
! 		    if (subsh)
  			_exit(lastval);
  		    if (unset(NORCS) && interact && sourcelevel < 32768)
  			/* save the history file through execs */
--- 1503,1509 ----
  
  	    if (!forked) {
  		if (cmd->flags & CFLAG_EXEC) {
! 		    if (subsh == 1)
  			_exit(lastval);
  		    if (unset(NORCS) && interact && sourcelevel < 32768)
  			/* save the history file through execs */
***************
*** 1528,1534 ****
  	} else {
  	    if (cmd->flags & CFLAG_EXEC) {
  		setiparam("SHLVL", --shlvl);
! 		if (unset(NORCS) && interact && !subsh && sourcelevel < 32768)
  		    /* save the history file through execs */
  		    savehistfile(getsparam("HISTFILE"), 1, isset(APPENDHISTORY) ? 3 : 0);
  	    }
--- 1529,1536 ----
  	} else {
  	    if (cmd->flags & CFLAG_EXEC) {
  		setiparam("SHLVL", --shlvl);
! 		if (unset(NORCS) && interact && subsh != 1
! 		    && sourcelevel < 32768)
  		    /* save the history file through execs */
  		    savehistfile(getsparam("HISTFILE"), 1, isset(APPENDHISTORY) ? 3 : 0);
  	    }

-- 
Peter Stephenson <P.Stephenson@swansea.ac.uk>  Tel: +44 1792 205678 extn. 4461
WWW:  http://python.swan.ac.uk/~pypeters/      Fax: +44 1792 295324
Department of Physics, University of Wales, Swansea,
Singleton Park, Swansea, SA2 8PP, U.K.


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

end of thread, other threads:[~1995-09-08 17:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1995-09-07 19:26 history file re-writing in sub-shell Yoshiaki KASAHARA
1995-09-07 20:03 ` Zoltan Hidvegi
1995-09-08 16:29   ` P.Stephenson

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).