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

Fix HISTFILE, HISTSIZE, HISTFILESIZE that /usr/share/zsh/manjaro-zsh-config keeps overriding #106

Closed
Tracked by #102
trinitronx opened this issue Sep 12, 2024 · 1 comment · Fixed by trinitronx/dotfiles#63
Labels
bug enhancement Hacktoberfest Hacktoberfest issues for DigitalOcean

Comments

@trinitronx
Copy link
Collaborator

trinitronx commented Sep 12, 2024

The detangling of multiple problems:

  • ~/.config/zsh/.zshrc Loads ~/.config/zsh/config.d/*, which includes 00-history-size.zsh
  • ~/.config/zsh/.zshrc MUST Load ~/.zshrc AFTER, due to bugs in Manjaro's config:
  • ~/.zshrc Is loaded, and was working around the issue by setting select-word-style bash AND using ZSH_AUTOSUGGEST_IGNORE_WIDGETS workaround.
    • However, something in Manjaro config changed and ZSH_AUTOSUGGEST_IGNORE_WIDGETS workaround is now failing to work also!
    • The culprit is Autosuggest eats buffer by ctrl+w zsh-users/zsh-autosuggestions#363
    • Reference: zsh yanks only last cut word
    • Enabling BOTH select-word-style bash AND the ZSH_AUTOSUGGEST_IGNORE_WIDGETS does not work
    • Yet, with select-word-style bash disabled and $ZSH_AUTOSUGGEST_IGNORE_WIDGETS set... it works again! (╯°□°)╯︵ ┻━┻
    • Because these things must happen before + after sourcing /usr/share/zsh/manjaro-zsh-config, they are constrained to be in this file. Yet, because ~/.zshrc is sourced AFTER the ~/.config/zsh/config.d/* and thus 00-history-size.zsh, it causes a problem with HISTFILE being overridden!
    • We therefore have a Catch-22
@trinitronx
Copy link
Collaborator Author

trinitronx commented Sep 12, 2024

Decided to work around part of this problem for at least HISTFILE + HISTFILESIZE by moving them into ~/.config/profile.d/. Those files get sourced at the end of ~/.zshrc, by my own design, to override anything else.

.profile source Details

$ tail -n1 ~/.zshrc:

source ${HOME}/.config/zsh/.zprofile

~/.config/zsh/.zprofile:

emulate sh -c 'source ~/.profile'

~/.profile:

#!/bin/sh

set -a
. "$HOME/.config/user-dirs.dirs"
set +a

if [ -n "$(ls "$HOME"/.config/profile.d 2>/dev/null)" ]; then
    for f in "$HOME"/.config/profile.d/*; do
        # shellcheck source=/dev/null
        . "$f"
    done
fi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug enhancement Hacktoberfest Hacktoberfest issues for DigitalOcean
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant