You are not logged in.

#1 2010-12-08 10:58:22

lichray
Member
Registered: 2010-12-08
Posts: 7

zsh fails to enable history

I installed the zsh in the repository, and configured it according to the ArchWiki. I used .zprofile to configure the ENVs and .zshrc to configure the interactive shell. A login shell read both of them, as I'm confirmed. I used HISTFILE="$HOME/.zhistory" to enable the history, but its has no effect. The file was not created. Although I created it, zsh writes no history into it. Whatever I setopt APPEND_HISTORY, I still see no effect. What should I do now? Any suggestions are welcome, except the ones which let me change my shell :-)

Last edited by lichray (2010-12-08 10:58:53)

Offline

#2 2010-12-08 11:10:36

litemotiv
Forum Fellow
Registered: 2008-08-01
Posts: 5,026

Re: zsh fails to enable history

Isn't the option called:

setop INC_APPEND_HISTORY

?


ᶘ ᵒᴥᵒᶅ

Offline

#3 2010-12-08 16:05:56

lichray
Member
Registered: 2010-12-08
Posts: 7

Re: zsh fails to enable history

litemotiv wrote:

Isn't the option called:

setop INC_APPEND_HISTORY

?

This options is supposed to make parallel instances of zsh write to the history file, which behaviors different from APPEND_HISTORY. But the problem what I met is not the behaviors... the problem is no options behaves! Zsh just does not write history!

Offline

#4 2010-12-08 16:06:22

thestinger
Trusted User (TU)
From: Toronto, Canada
Registered: 2010-01-23
Posts: 478

Re: zsh fails to enable history

did you set HISTSIZE?

Offline

#5 2010-12-08 16:07:57

lichray
Member
Registered: 2010-12-08
Posts: 7

Re: zsh fails to enable history

thestinger wrote:

did you set HISTSIZE?

Yes. As well as SAVEHIST.

Offline

#6 2010-12-08 23:02:11

Knute
Member
From: Minot, ND
Registered: 2009-03-17
Posts: 604

Re: zsh fails to enable history

I just checked my ~/.zshrc file for the HISTFILE variable.
Mine is listed as:

HISTFILE=~/.histfile

The difference I see between your example and mine other than mine is working, is that your example is using quotes and the $HOME rather than no quotes and the tilda.

Could the issue perhaps be simple syntax rather than anything more major?

[edit]  I ask because the different quotation marks have different meanings when it comes to exanding variables and such, and could be causing the issue.[/edit]

Last edited by Knute (2010-12-08 23:04:47)


Knute

Offline

#7 2010-12-09 00:16:28

lichray
Member
Registered: 2010-12-08
Posts: 7

Re: zsh fails to enable history

I tried many different ways to write HISTFILE. Not this issue.
The reason I want to use zsh is... I'm an 'old' tcsh user. I saw tcsh on Arch's package site, but I don't know why I can't install it from neither extra nor community-testing. And I failed to configure bash to match tcsh's behaviors. But I found that I can do it with zsh...

Offline

#8 2010-12-11 12:06:21

modulation
Member
Registered: 2010-02-27
Posts: 6

Re: zsh fails to enable history

I'd suggest you try to do a fresh start without .zprofile and just a minimal ~/.zshrc like:

umask 022
setopt APPEND_HISTORY
setopt SHARE_HISTORY
setopt NOTIFY
setopt NOHUP
setopt MAILWARN

HISTFILE=$HOME/.zsh_history
HISTSIZE=5000
SAVEHIST=5000

Another solution would be to use the very convinient grml zsh setup, just adopt the .zshrc.local to your needs and you're set:
http://grml.org/zsh/

mkdir /etc/zsh && wget -O /etc/zsh/zshrc http://git.grml.org/f/grml-etc-core/etc/zsh/zshrc
wget -O ~/.zshrc.local http://git.grml.org/f/grml-etc-core/etc/skel/.zshrc

Offline

#9 2010-12-11 17:12:28

lichray
Member
Registered: 2010-12-08
Posts: 7

Re: zsh fails to enable history

It - just - has - no - effect. I used the minimal .zshrc file without .zprofile
Now I know how GNU guys force other communities members to adapt themselves to GNU.... I guess I'd better think about how to configure fxxxing bash now.

Offline

#10 2010-12-11 20:23:24

Spacenick
Member
From: Germany
Registered: 2010-04-02
Posts: 168

Re: zsh fails to enable history

to me it sounds like there is definite;y something awfully broken, if even with the minimal .zsrc histroy doesn't work.

Offline

#11 2010-12-11 21:35:10

Knute
Member
From: Minot, ND
Registered: 2009-03-17
Posts: 604

Re: zsh fails to enable history

Ok, so post your .z-files, and we'll see what we can see. 

Also, what kind of permissions do you have on the files?   I'm guessing that they must be readable at least to the user and possibly the group.


Knute

Offline

Board footer

Powered by FluxBB