zsh-users
 help / color / mirror / code / Atom feed
* Problems with history on macOS
@ 2024-02-14 17:08 Perry Smith
  2024-02-14 23:42 ` Bart Schaefer
  0 siblings, 1 reply; 3+ messages in thread
From: Perry Smith @ 2024-02-14 17:08 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 2424 bytes --]

I’ve been fighting this for a year and I guess I will come to the experts.

I want to have one single giant history file and I can’t seem to get that.  It has hovered around 1500 lines.

In /etc/zshenv I have:

> if [[ -z "$XDG_CONFIG_HOME" ]]
> then
>         export XDG_CONFIG_HOME="$HOME/.config"
> fi
> 
> if [[ -z "$XDG_CACHE_HOME" ]]
> then
>         export XDG_CACHE_HOME="$HOME/.cache"
> fi
> 
> if [[ -d "$XDG_CONFIG_HOME/zsh" ]]
> then
>         export ZDOTDIR="$XDG_CONFIG_HOME/zsh"
> fi

I don’t recall if that is stock macOS or not.  The result is:

> XDG_CACHE_HOME=/Users/pedz/.cache
> XDG_CONFIG_HOME=/Users/pedz/.config
> ZDOTDIR=/Users/pedz/.config/zsh

/Users/pedz/.config/zsh/.zshenv is a symbolic link… sometimes that makes a difference so I’ll mention it.

In there I have (amount other things)

> export SHELL_SESSIONS_DISABLE=1
> export SHELL_SESSION_HISTORY=0


I added the DISABLE line a year ago.

In my login (also symbolically linked) is:

> : ${HISTFILE:=${ZDOTDIR:-$HOME}/.zsh_history}
> SAVEHIST=1048576
> (( HISTSIZE = SAVEHIST * 2 ))

If I do: env|grep SESS I get:

> TERM_SESSION_ID=C5339770-2EA7-49CA-A308-355511F0EE71
> SHELL_SESSIONS_DISABLE=1
> SHELL_SESSION_HISTORY=0

And if I do:  set | grep HIST  I get:

> HISTCHARS='!^#'
> HISTCMD=1585
> HISTFILE=/Users/pedz/.config/zsh/.zsh_history
> HISTSIZE=2097152
> LESSHISTFILE=/Users/pedz/.cache/less/history
> SAVEHIST=1048576
> SHELL_SESSION_HISTORY=0

The absurd 1M and 2M numbers I put out of frustration.

As you can see, my current history is about 1500 lines long.

Here are the pertinent options I have set — many I set explicitly in my login file:

> appendhistory := on
> banghist := on
> cshjunkiehistory := off
> extendedhistory := on
> histallowclobber := off
> histappend := on
> histbeep := on
> histexpand := on
> histexpiredupsfirst := on
> histfcntllock := off
> histfindnodups := on
> histignorealldups := on
> histignoredups := on
> histignorespace := off
> histlexwords := off
> histnofunctions := off
> histnostore := on
> histreduceblanks := on
> histsavebycopy := on
> histsavenodups := on
> histsubstpattern := off
> histverify := off
> incappendhistory := off
> incappendhistorytime := off
> sharehistory := off


Please let me know if you see what I’m doing wrong.

Thank you for your time,
Perry



[-- Attachment #2: Message signed with OpenPGP --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

end of thread, other threads:[~2024-04-14 17:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-14 17:08 Problems with history on macOS Perry Smith
2024-02-14 23:42 ` Bart Schaefer
2024-04-14 17:57   ` Chris Nebel

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