Closed MarcinGil closed 3 years ago
@MarcinGil I'm on macOS using ZSH and can't reproduce this. I have the same invocation and oh-my-posh doesn't really do much other than set the prompt, every other behaviour should stay the same. Are you certain there's nothing in your setup that influences this?
EDIT: hold it, it seems the latest version does ruin this. I was on 3.120.1 before. I'll check.
seems to work with the latest version(wsl ubuntu):
I also use these plugins: plugins=(common-aliases git zsh-autosuggestions zsh-syntax-highlighting)
And autosuggestions works based on the history.
@lnu it worked for me until I upgraded. So I can reproduce this. I'll try to figure out a fix (but I'm afraid we could be duplicating history in that case).
@JanDeDobbeleer how did you reproduce it? I tried my local build and I also downloaded the latest version and in wsl at least it works as expected. Is it a link to a specific configuration ?
PS: if I don't use oh-my-zsh I can reproduce it. But in that case, you have ton configure zsh history in the .zshrc manually. Like this:
SAVEHIST=10
HISTFILE=~/.zsh_history
@lnu for me this is enough to reproduce
PS: I'll try your solution to manually specify history file.
So you don't use oh-my-zsh and history does not work? but when you user oh-my-zsh it works because history is configured automatically. Can you try to add this in your .zshrc:
SAVEHIST=10
HISTFILE=~/.zsh_history
Without those lines I can reproduce your issue but it works when they're added to .zshrc.
@lnu @JanDeDobbeleer It works with manual setting of the history file
PS. I didn't know you could actually have OhMyZSH and OhMyPosh together.
Ohmyzsh does more than just setting the prompt. You can mix both to get all the plugins from ohmyzsh and only use ohmyposh to override th prompt.
@lnu HISTFILE
is set for me, I wonder if it's only the SAVEHIST
part.
https://unix.stackexchange.com/questions/389881/history-isnt-preserved-in-zsh
Argh! Simply means I relied too much on magic as I usually configure Zsh and OhMyZsh together. Thank you for insight @lnu !
@JanDeDobbeleer I believe we can close the issue as won't fix. Sorry for taking your time guys.
@MarcinGil it was our pleasure! Learned something today thx to @lnu 👍🏻💪🏻
This issue has been automatically locked since there has not been any recent activity (i.e. last half year) after it was closed. It helps our maintainers focus on the active issues. If you have found a problem that seems similar, please open a discussion first, complete the body with all the details necessary to reproduce, and mention this issue as reference.
Prerequisites
CONTRIBUTING
guideDescription
Using ZSH in Ubuntu my terminals are started with clean history even though a huge .zhistory exists.
Environment
Steps to Reproduce
eval "$(oh-my-posh --init --shell zsh --config ~/.poshthemes/powerlevel10k_classic.omp.json)"
Expected behavior: [What you expected to happen]
History works fine
Actual behavior: [What actually happened]
ZSH history file is ignored and not updated. New commands are not added there and the shell is also unable to look through the history.
When using Oh My ZSH (and Powerlevel 10k theme) everything works fine