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

Error on pull #22

Closed
peterbladen opened this issue Mar 23, 2023 · 3 comments · Fixed by #24
Closed

Error on pull #22

peterbladen opened this issue Mar 23, 2023 · 3 comments · Fixed by #24

Comments

@peterbladen
Copy link

When I do a zhpl I get the following -

gpg: encrypted with rsa4096 key, ID xxxx, created 2020-02-25
"xxxx"
gpg: Signature made Thu 23 Mar 15:19:25 2023 GMT
gpg: using RSA key xxxxx
gpg: Good signature from "xxxxx" [ultimate]
sed: 1: ":a;N;$!ba;s/\n/ pVeiz0P ...": unused label 'a;N;$!ba;s/\n/ pVeiz0PnBeyWcAN8UmndM4lv1ggDdWDb /g'
sed: 1: ":a;N;$!ba;s/\n/ pVeiz0P ...": unused label 'a;N;$!ba;s/\n/ pVeiz0PnBeyWcAN8UmndM4lv1ggDdWDb /g'
sed: RE error: illegal byte sequence
sed: 1: "/Users/xxx/.zsh_history": extra characters at the end of p command

@wulfgarpro
Copy link
Owner

wulfgarpro commented Mar 23, 2023 via email

@peterbladen
Copy link
Author

I am using macOS Ventura and its sed version is 13.2.1 , I did look at my zsh_history I don't see any weird references

I tried the LC_CTYPE=C zhpl

slightly different error but same result

sed: 1: ":a;N;$!ba;s/\n/ WSv3ban ...": unused label 'a;N;$!ba;s/\n/ WSv3ban9mldLqK9ISxJZLieBB30rizUF /g'

@luong-komorebi
Copy link

@peterbladen try this

Method 1: Use gnused

brew install gnu-sed
brew install gawk 

# then replace them with the built in version inside mac os by specifying in this in your bashrc, zshrc (basically your shell init configuration file)
# # gnu sed to replace macos sed
PATH="/usr/local/opt/gnu-sed/libexec/gnubin:$PATH"]
# # gnu awk to replace macos awk
PATH="/usr/local/opt/gawk/libexec/gnubin:$PATH"

# later, check if sed is from gnu version by 

which sed 

# or 
sed --version

# it should show you that sed is not /usr/bin/sed but /usr/local/opt/gnu-sed/libexec/gnubin/sed
# and the version argument will succeed (on mac os version, it will fail saying there is no such option)

After this step, you could run your command as expected

Method 2:
Filter and remove non utf8 characters from history

iconv -f utf-8 -t utf-8 -c ~/.zsh_history

wulfgarpro added a commit that referenced this issue Sep 13, 2023
wulfgarpro added a commit that referenced this issue Sep 13, 2023
wulfgarpro added a commit that referenced this issue Sep 13, 2023
wulfgarpro added a commit that referenced this issue Sep 13, 2023
wulfgarpro added a commit that referenced this issue Sep 13, 2023
wulfgarpro added a commit that referenced this issue Sep 13, 2023
wulfgarpro added a commit that referenced this issue Sep 13, 2023
wulfgarpro added a commit that referenced this issue Sep 16, 2023
wulfgarpro added a commit that referenced this issue Sep 16, 2023
wulfgarpro added a commit that referenced this issue Sep 16, 2023
wulfgarpro added a commit that referenced this issue Sep 16, 2023
wulfgarpro added a commit that referenced this issue Sep 16, 2023
wulfgarpro added a commit that referenced this issue Sep 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants