skywind3000 / skywind3000/z.lua

use fz.sh has error: failed to compile regex: trailing backslash (\)

Open
#224 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Lua
Stars
3.1k
Forks
148
PR merge metrics
No merged PRs in 30d

Description

Image

File: /data/data/com.termux/files/home/.zshrc

if [[ ! -f $HOME/.local/share/zinit/zinit.git/zinit.zsh ]]; then
    print -P "%F{33} %F{220}Installing %F{33}ZDHARMA-CONTINUUM%F{220} Initiative Plugin Manager (%F{33}zdharma-continuum/zinit%F{220})…%f"
    command mkdir -p "$HOME/.local/share/zinit" && command chmod g-rwX "$HOME/.local/share/zinit"
    command git clone https://github.com/zdharma-continuum/zinit "$HOME/.local/share/zinit/zinit.git" && \
        print -P "%F{33} %F{34}Installation successful.%f%b" || \
        print -P "%F{160} The clone has failed.%f%b"
fi

# 1) 加载 Zinit
source "$HOME/.local/share/zinit/zinit.git/zinit.zsh"
autoload -Uz _zinit
(( ${+_comps} )) && _comps[zinit]=_zinit

# 2) 加载 annexes
zinit light-mode for \
  zdharma-continuum/zinit-annex-as-monitor \
  zdharma-continuum/zinit-annex-bin-gem-node \
  zdharma-continuum/zinit-annex-patch-dl \
  zdharma-continuum/zinit-annex-rust

# 1) 启用 zsh 补全
autoload -Uz compinit
compinit

# 2) 加载 z.lua(只启用 enhanced/once,不走 fzf 补全)
zinit light skywind3000/z.lua
eval "$(lua "$ZINIT[PLUGINS_DIR]/skywind3000---z.lua/z.lua" --init zsh enhanced once)"

# 3) 定义 _z 和通知 fz.sh 用 _zlua
function _z() { _zlua "$@"; }
export FZ_HISTORY_CD_CMD=_zlua

# 4) 最后加载 fz.sh
zinit light mrjohannchang/fz.sh

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the error with the provided /data/data/com.termux/files/home/.zshrc configuration, especially the zinit loading of skywind3000/z.lua and mrjohannchang/fz.sh. Inspect the fz.sh integration and determine which input produces the trailing-backslash regex error; done means the shown setup no longer fails to compile the regex.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua, zsh
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.