Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not remembering history past session #645

Closed
cawoodm opened this issue Jan 11, 2022 · 4 comments
Closed

Not remembering history past session #645

cawoodm opened this issue Jan 11, 2022 · 4 comments
Labels

Comments

@cawoodm
Copy link

cawoodm commented Jan 11, 2022

Describe the bug

Autocomplete history is not being written - I get autocompletion of commands inside my session but when I exit zsh and return, everything is forgotten.

To Reproduce

Steps to reproduce the behavior:

% zsh -df
% source path/to/zsh-autosuggestions.zsh
% ls foo
% ls # auto suggest, inserts ls foo here
% exit zsh
% zsh
% ls # Nothing is suggested

Expected behavior

I expect auto suggest to persist across sessions.
I have deleted both my .bash_history and .zsh_history - permissions were rw.
They are not being re-created as I use zsh.

Screenshots

Desktop

  • OS + distribution: Ubuntu 20.04
  • Zsh version: 5.8
  • Plugin version: latest

Additional context

@cawoodm cawoodm added the bug label Jan 11, 2022
@cawoodm
Copy link
Author

cawoodm commented Jan 11, 2022

.zshrc

export SHELL=$(which zsh)
export PATH=$HOME/bin:/usr/local/bin:$PATH
export ZSH="$HOME/.oh-my-zsh"

ZSH_THEME="rkj"
ZSH_CUSTOM=~/.oh-my-zsh/custom
plugins=(git zsh-autosuggestions zsh-syntax-highlighting)
source $ZSH_CUSTOM/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
#ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=8'

alias zshconfig="vi ~/.zshrc"
alias ohmyzsh="vi ~/.oh-my-zsh"
alias cls=clear
alias md=mkdir
alias ls="ls -alF --color=auto"

eval "$(starship init zsh)"

figlet zsh

@guillaumeboehm
Copy link

guillaumeboehm commented Jan 12, 2022

same issue with bare minimum .zshrc with only:
source $HOME/.config/zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
#416 or #604 didn't help

@ericfreese
Copy link
Member

Zsh doesn't persist history across sessions by default. Take a look here or Google around for how to configure zsh to persist history across sessions:

https://unix.stackexchange.com/questions/389881/history-isnt-preserved-in-zsh

@tylerferrara
Copy link

Try this!

# inside .zshrc
setopt APPEND_HISTORY
setopt SHARE_HISTORY
HISTFILE=$HOME/.zhistory
SAVEHIST=1000
HISTSIZE=999
setopt HIST_EXPIRE_DUPS_FIRST
setopt EXTENDED_HISTORY

source: https://dev.to/rossijonas/how-to-set-up-history-based-autocompletion-in-zsh-k7o

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants