zsh-workers
 help / color / mirror / code / Atom feed
* Issue with history
@ 2012-03-08 16:41 François
  2012-03-08 18:28 ` Bart Schaefer
  0 siblings, 1 reply; 7+ messages in thread
From: François @ 2012-03-08 16:41 UTC (permalink / raw)
  To: zsh-workers; +Cc: aifsair+zsh

Hello there,

after a talk on IRC, ft asked me to report this on that mailing. Please leave the CC: so that I get answer without need to subscribe to this list.

So here are the facts, with my history file (HISTFILE=$HOME/.zsh_history) available here ( http://www.fser.lautre.net/zsh-history.txt ), 
I couldn't retrieve all the entries from my history file.

$ history  # would only produce something like 30 entries
$ history 1 # would add few entries but not much
$ wc -l ~/.zsh_history # would return 1035+ lines (I removed some on the online version)

As far as I remember, I didn't changed any parameters.
I just added the shared_history parameter right now, which explains the timestamp on the file.

After a complete flush of the file, I get a "normal" behaviour.

$ history # gives me 25 lines, didn't find that parameter though
$ history 1 # gives me commands from number 1 so everything looks ok

I don't know if this mail is a bug report, but there is definitely something I don't understand here.

Thanks for reading.

--
François


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

* Re: Issue with history
  2012-03-08 16:41 Issue with history François
@ 2012-03-08 18:28 ` Bart Schaefer
  2012-03-08 23:05   ` François
  0 siblings, 1 reply; 7+ messages in thread
From: Bart Schaefer @ 2012-03-08 18:28 UTC (permalink / raw)
  To: François, zsh-workers; +Cc: aifsair+zsh

On Mar 8,  5:41pm, François wrote:
}
} I couldn't retrieve all the entries from my history file.
} 
} $ history  # would only produce something like 30 entries

The doc:

history
     Same as fc -l.

fc -l [ -nrdfEiD ] [ -t TIMEFMT ] [ -m MATCH ] [ OLD=NEW ... ] [ FIRST [ LAST ] ]
     If FIRST is not specified, it will be set to -1 (the most recent
     event), or to -16 if the -l flag is given.  If LAST is not
     specified, it will be set to FIRST, or to -1 if the -l flag is
     given.

So by default "history" lists only 16 lines of commands.  If you get more
than 16, you must already have an alias or function named "history" that
is passing some other values.  Given that you have an alias/function, it
isn't possible to determine what "history 1" means for you.

-- 
Barton E. Schaefer


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

* Re: Issue with history
  2012-03-08 18:28 ` Bart Schaefer
@ 2012-03-08 23:05   ` François
  2012-03-09  3:25     ` Bart Schaefer
  0 siblings, 1 reply; 7+ messages in thread
From: François @ 2012-03-08 23:05 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: zsh-workers, aifsair+zsh

Thanks for your answer.
FYI: 
$ type history
history is a shell builtin

What further information can I provide you?

--
François

Le 8 mars 2012 à 19:28, Bart Schaefer a écrit :

> On Mar 8,  5:41pm, François wrote:
> }
> } I couldn't retrieve all the entries from my history file.
> } 
> } $ history  # would only produce something like 30 entries
> 
> The doc:
> 
> history
>     Same as fc -l.
> 
> fc -l [ -nrdfEiD ] [ -t TIMEFMT ] [ -m MATCH ] [ OLD=NEW ... ] [ FIRST [ LAST ] ]
>     If FIRST is not specified, it will be set to -1 (the most recent
>     event), or to -16 if the -l flag is given.  If LAST is not
>     specified, it will be set to FIRST, or to -1 if the -l flag is
>     given.
> 
> So by default "history" lists only 16 lines of commands.  If you get more
> than 16, you must already have an alias or function named "history" that
> is passing some other values.  Given that you have an alias/function, it
> isn't possible to determine what "history 1" means for you.
> 
> -- 
> Barton E. Schaefer


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

* Re: Issue with history
  2012-03-08 23:05   ` François
@ 2012-03-09  3:25     ` Bart Schaefer
  2012-03-14  9:59       ` François
  0 siblings, 1 reply; 7+ messages in thread
From: Bart Schaefer @ 2012-03-09  3:25 UTC (permalink / raw)
  To: François; +Cc: zsh-workers, aifsair+zsh

On Thu, Mar 8, 2012 at 3:05 PM, François <aifsair@gmail.com> wrote:
> Thanks for your answer.
> FYI:
> $ type history
> history is a shell builtin
>
> What further information can I provide you?

Hmm.  Well, another possibility may be that you have several zsh
running that are sharing the same history file, but that don't have
the same set of history options so they're writing contradictory
formats or truncating the file in different ways.  There's at least
one oddball line in the zsh-history.txt file you posted at that would
suggest that is happening.  Try making sure that you've exited out of
all but one of your shells before changing history format or sharing
options.


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

* Re: Issue with history
  2012-03-09  3:25     ` Bart Schaefer
@ 2012-03-14  9:59       ` François
  2012-03-15  0:58         ` Bart Schaefer
  0 siblings, 1 reply; 7+ messages in thread
From: François @ 2012-03-14  9:59 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: zsh-workers, aifsair+zsh

Hi,

the issue appeared again, without any changing to my config file since the other day.
There is still a big change that appeared in my .zsh_history:

[…]
vim .emacs
find . -name '*.c'
open -a emacs  Downloads/ddns-1.0/message.c
: 1331470574:0;ssh elma
: 1331508808:0;python/
[…]

I have really no idea why this changed, since I made no change on my .zshrc.

Hope this issue is relevant. I can provide more information if needed.
Have a nice day.

--
François

Le 9 mars 2012 à 04:25, Bart Schaefer a écrit :

> On Thu, Mar 8, 2012 at 3:05 PM, François <aifsair@gmail.com> wrote:
>> Thanks for your answer.
>> FYI:
>> $ type history
>> history is a shell builtin
>> 
>> What further information can I provide you?
> 
> Hmm.  Well, another possibility may be that you have several zsh
> running that are sharing the same history file, but that don't have
> the same set of history options so they're writing contradictory
> formats or truncating the file in different ways.  There's at least
> one oddball line in the zsh-history.txt file you posted at that would
> suggest that is happening.  Try making sure that you've exited out of
> all but one of your shells before changing history format or sharing
> options.


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

* Re: Issue with history
  2012-03-14  9:59       ` François
@ 2012-03-15  0:58         ` Bart Schaefer
  2012-03-15 10:13           ` François
  0 siblings, 1 reply; 7+ messages in thread
From: Bart Schaefer @ 2012-03-15  0:58 UTC (permalink / raw)
  To: François; +Cc: zsh-workers, aifsair+zsh

On Wed, Mar 14, 2012 at 2:59 AM, François <aifsair@gmail.com> wrote:
>
> There is still a big change that appeared in my .zsh_history:
>
> […]
> vim .emacs
> find . -name '*.c'
> open -a emacs  Downloads/ddns-1.0/message.c

So, where did you execute those particular commands?

It begins to appear that you (unintentionally) have history configured
differently for login shells as compared to other interactive shells.
For example, /etc/zlogin may be resetting some history options and
thereby replacing the ones that you have in your .zshrc.

Try running

zsh -x -i 2> /tmp/zshxi
zsh -x -l 2> /tmp/zshxl
diff -u /tmp/zshxi /tmp/zshxl | more

then search through the diff for unexpected setopt commands, etc.


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

* Re: Issue with history
  2012-03-15  0:58         ` Bart Schaefer
@ 2012-03-15 10:13           ` François
  0 siblings, 0 replies; 7+ messages in thread
From: François @ 2012-03-15 10:13 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: zsh-workers, aifsair+zsh

Hi again,

thanks for your response.

I've just rebooted, and `history 1` function gives me an arbitrary command, which I hit yesterday evening.
If I hit `history 1` again, the cursors switches to the next function.

Something else I have noticed, if I edit the history file, I get the 
: 1331806147:0;history 0
: 1331806161:0;fc

notation. But it seems that only the history of current instance(s) has such additional informations.

And the zsh -x -i or -l does not give a lot of differences as far as I understand.

I'll let you know if I find more information on that.
I think I'll create a h() function which will just call grep on my history file :p

--
François

Le 15 mars 2012 à 01:58, Bart Schaefer a écrit :

> On Wed, Mar 14, 2012 at 2:59 AM, François <aifsair@gmail.com> wrote:
>> 
>> There is still a big change that appeared in my .zsh_history:
>> 
>> […]
>> vim .emacs
>> find . -name '*.c'
>> open -a emacs  Downloads/ddns-1.0/message.c
> 
> So, where did you execute those particular commands?
> 
> It begins to appear that you (unintentionally) have history configured
> differently for login shells as compared to other interactive shells.
> For example, /etc/zlogin may be resetting some history options and
> thereby replacing the ones that you have in your .zshrc.
> 
> Try running
> 
> zsh -x -i 2> /tmp/zshxi
> zsh -x -l 2> /tmp/zshxl
> diff -u /tmp/zshxi /tmp/zshxl | more
> 
> then search through the diff for unexpected setopt commands, etc.


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

end of thread, other threads:[~2012-03-15 10:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-08 16:41 Issue with history François
2012-03-08 18:28 ` Bart Schaefer
2012-03-08 23:05   ` François
2012-03-09  3:25     ` Bart Schaefer
2012-03-14  9:59       ` François
2012-03-15  0:58         ` Bart Schaefer
2012-03-15 10:13           ` François

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