z-shell / F-Sy-H

⚙️ Feature-rich Syntax Highlighting for Zsh
https://wiki.zshell.dev/search?q=F-Sy-H
BSD 3-Clause "New" or "Revised" License
165 stars 24 forks source link

Do not assume selected theme is in a cache dir #24

Closed bew closed 2 years ago

bew commented 2 years ago

When ~/.cache is a tmpfs, the selected theme is lost on reboot. This commit ensures that the selected theme is searched in $FAST_WORK_DIR when it is set instead of assuming it is in a cache directory.

bew commented 2 years ago

It seems it's still not perfect though, as when starting a new shell it still writes somehow a secondary theme:

ls -l .cache/fsh/
.rw-r--r-- 3.4k lesell_b 12 May 23:51 secondary_theme.zsh`

Not sure where that one comes from :eyes:

bew commented 2 years ago

Ok it seems I didn't solve it at all: (I probably should have created a proper issue first)

I have:

FAST_WORK_DIR=~/.long_term_cache/zsh--fast-syntax-highlighting
echo "FAST_WORK_DIR (before zi): $FAST_WORK_DIR"

zi light z-shell/F-Sy-H

echo "FAST_WORK_DIR (after zi): $FAST_WORK_DIR"

And when starting zsh I get:

FAST_WORK_DIR (before zi): /home/lesell_b/.long_term_cache/zsh--fast-syntax-highlighting
FAST_WORK_DIR (after zi): /home/lesell_b/.cache/fsh
ss-o commented 2 years ago

It seems it's still not perfect though, as when starting a new shell it still writes somehow a secondary theme:

ls -l .cache/fsh/
.rw-r--r-- 3.4k lesell_b 12 May 23:51 secondary_theme.zsh`

Not sure where that one comes from eyes

Hi @bew :wave:

Could you describe your environment e.g:

echo "OSTYPE=${OSTYPE} CPUTYPE=$(uname -m) MACHINE_TYPE=$MACHTYPE ZSH_VERSION=${ZSH_VERSION}"

Or any other additional information which would help to reproduce the issue, this data also gets collected to improve tests. I keep forgetting to update issue templates

bew commented 2 years ago

Sure, I created a separate issue, I've put the requested env in it: #25

bew commented 2 years ago

I'm not sure what you want me to do for my tentative PR, I'll just close that PR (it's so small anyway) and let you do the changes.