Pure: Command duplicated on tab completion with oh-my-zsh and Hyper

Created on 25 Feb 2017  路  12Comments  路  Source: sindresorhus/pure

General information

  • Pure version: latest
  • ZSH version: 5.3.1
  • Terminal program & version: Hyper 1.2.1.1527
  • Operating system: macOS Sierra 10.12.13
  • ZSH framework: oh-my-zsh, zsh 5.3.1

I have:

  • [x] Tested with another terminal program and can reproduce the issue:
  • [x] Followed the Integration instructions for my framework

Problem description

I have completely wiped out everything and did a new installation because of duplicate cp problem and here is what I am getting.
2017-02-24 7 19 20

Reproduction steps

  1. Deleted everything to start over
  2. Followed Integration for oh-my-zsh

Here is my reinstallation process that I just did

$ mkdir ~/.oh-my-zsh/functions
$ ln -s  "$PWD/pure.zsh" ~/.oh-my-zsh/functions/prompt_pure_setup
$ ln -s "$PWD/async.zsh" ~/.oh-my-zsh/functions/async
$ ln -s "$PWD/pure.zsh" ~/.oh-my-zsh/custom/pure.zsh-theme
$ ln -s "$PWD/async.zsh" ~/.oh-my-zsh/custom/async.zsh

$ ln -s "$PWD/pure.zsh" /usr/local/share/zsh/site-functions/prompt_pure_setup
$ ln -s "$PWD/async.zsh" /usr/local/share/zsh/site-functions/async

My .zshrc:

export PATH=$HOME/bin:/usr/local/bin:$PATH
export ZSH=/Users/yoon/.oh-my-zsh
ZSH_THEME="pure"
autoload -U promptinit; promptinit
prompt pure
plugins=(git)
source $ZSH/oh-my-zsh.sh

My .hyper.js:

shell: '/usr/local/bin/zsh'
plugins: ['hyper-snazzy']

Most helpful comment

meet the same problem but fixed after setting this in .zshrc

export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8

still thanks for figure out the problem, it should be a general issue

All 12 comments

tried #295.
get an error for not being able to read file and duplicate cd issue
2017-02-24 7 33 53

.zshrc

export ZSH=/Users/yoon/.oh-my-zsh
ZSH_THEME=""
plugins=(git)
source $ZSH/oh-my-zsh.sh

autoload -U promptinit; promptinit
prompt pure

without pure in

ZSH_THEME=""

duplicate cd issue is gone but prompt symbol is missing

2017-02-24 7 36 41

.zshrc

export PATH=$HOME/bin:/usr/local/bin:$PATH
export ZSH=/Users/yoon/.oh-my-zsh
ZSH_THEME=""
autoload -U promptinit; promptinit
prompt pure
plugins=(git)
source $ZSH/oh-my-zsh.sh

I ended up facing the same problem..
This does not happen in Mac Terminal.

2017-02-24 8 13 24

.zshrc

export ZSH=/Users/yoon/.oh-my-zsh
ZSH_THEME=""
export PATH=$HOME/bin:/usr/local/bin:$PATH
source $ZSH/oh-my-zsh.sh
autoload -U promptinit; promptinit
prompt pure
plugins=(git)

Regarding your reinstallation process you should only do one of:

$ ln -s  "$PWD/pure.zsh" ~/.oh-my-zsh/functions/prompt_pure_setup
$ ln -s "$PWD/async.zsh" ~/.oh-my-zsh/functions/async

or

$ ln -s "$PWD/pure.zsh" ~/.oh-my-zsh/custom/pure.zsh-theme
$ ln -s "$PWD/async.zsh" ~/.oh-my-zsh/custom/async.zsh

or

$ ln -s "$PWD/pure.zsh" /usr/local/share/zsh/site-functions/prompt_pure_setup
$ ln -s "$PWD/async.zsh" /usr/local/share/zsh/site-functions/async

Personally I recommend against the middle variant, since OMZ contains the fake pure theme that conflicts with ours, which is a big reason for headache for both our users and us.

I also recommend (assuming not using the middle variant with .zsh-theme) that you use this as your .zshrc, exactly as written (order might be important):

# Setup oh-my-zsh
export ZSH=/Users/yoon/.oh-my-zsh
ZSH_THEME=""  # Disable OMZ themes
plugins=(git)
source $ZSH/oh-my-zsh.sh

# Load the pure theme
autoload -U promptinit; promptinit
prompt pure

Now from what you've reported here, I gather you still have the duplicate cd problem in Hyper?

First step, try disabling oh-my-zsh, here's the entire contents of your .zshrc:

fpath+=(~/.oh-my-zsh/functions)  # This is just to make pure available in $fpath if linked here.

# Load the pure theme
autoload -U promptinit; promptinit
prompt pure

Can you still reproduce the problem?

I have tried all solutions you mentioned but I still get the same problem.

This does not happen in regular terminal nor iterm2 but only in hyper. can it be a issue with hyper?

I figured it out 馃槀

The issue came from my mac's primary language set up in Korean. After changing back to English, duplicated command disappeared. It must have been the encoding issue with hyper terminal.

Thanks for the help though!

Awesome, glad you figured it out 馃槉.

meet the same problem but fixed after setting this in .zshrc

export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8

still thanks for figure out the problem, it should be a general issue

I faced the same issue.
I had the following in my .zshrc
export LANG=en_US.UTF-8
export LC_CTYPE=en_US.UTF-8

When I added export LC_CTYPE=en_US.UTF-8, the issue went away.

if still doesn't work, can try this as well (after adding those envs):

apt-get install -y locales \
    && dpkg-reconfigure locales \
    && locale-gen en_US.UTF-8

For docker do the following before install on Debian:

```shell

Set the locale

RUN apt-get install -y locales &&
dpkg-reconfigure locales &&
locale-gen en_US.UTF-8

ENV LANG=en_US.UTF-8
LC_ALL=en_US.UTF-8

```

For anyone who's experiencing the same issue lately, https://github.com/sindresorhus/pure/issues/300#issuecomment-386371460 fixed it on my machine (MacBook Pro, macOS Catalina, v10.15.7).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rawaludin picture rawaludin  路  3Comments

Rawnly picture Rawnly  路  9Comments

d3lm picture d3lm  路  3Comments

hyphaene picture hyphaene  路  9Comments

lezuber picture lezuber  路  11Comments