X-Spam-Check-By: sourceware.org To: cygwin AT cygwin DOT com From: Eli Barzilay Subject: Re: HISTFILE in zsh Date: 24 Dec 2006 16:34:02 -0500 Lines: 41 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Eli Barzilay writes: > I'm having the same problem that is described at > > http://www.cygwin.com/ml/cygwin/2004-12/msg00195.html > > I'm surprised that it was reported in 2004 -- I use cygwin on several > machines with no problems, it's only a new one that is having the > above symptom. > > (Which is related to saving/loading the history file -- `fc -R foo' > and `fc -W foo' also hang. Using strace, it looks like the problem is > some kind of an infinite loop that is related to a lock file for the > history file.) In case anyone else runs into this problem -- the best solution I could find is to just avoid loading/saving the history, and do it instead using my own hack -- listed below for reference: MYHISTFILE="$HISTFILE" unset HISTFILE while read L; do print -s "$L" done < "$MYHISTFILE" TRAPEXIT() { if [[ "$HISTCMD" != "0" ]]; then echo "Saving history..." if [[ ! -e "$MYHISTFILE" ]]; then touch "$MYHISTFILE"; fi fc -ln 0 -1 >> "$MYHISTFILE" rm -f "$MYHISTFILE-$$" tail -n "$SAVEHIST" "$MYHISTFILE" > "$MYHISTFILE-$$" cat "$MYHISTFILE-$$" > "$MYHISTFILE" rm -f "$MYHISTFILE-$$" fi } -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/