pindexis / marker

The terminal command palette
MIT License
2.02k stars 106 forks source link

zsh bug #19

Open kvokka opened 8 years ago

kvokka commented 8 years ago

With lash version of zsh i have double output like this:

 kvokka@kvokka-PC  ~                                                     1 ↵  3959  16:00:16 
search for: 
 apt-cache depends {{package}} Show dependencies for a package
 apt-cache policy {{package}} Show whether a package is installed and up to date
 apt-cache rdepends {{package}} Show packages that depend on a particular package
 apt-cache search {{query}} Search for a package in your current sources
 apt-cache show {{package}} Show information about a package
 apt-get dist-upgrade Upgrade installed packages (like "upgrade"), but remove obsolete packages and install additional packages to meet new dependencies
 apt-get install {{package}} Install a new package
 apt-get remove {{package}} Remove a package
 apt-get update Synchronize list of packages and versions available. This should be run first, before running subsequent apt-get commands
search for: 
 apt-cache depends {{package}} Show dependencies for a package
 apt-cache policy {{package}} Show whether a package is installed and up to date
 apt-cache rdepends {{package}} Show packages that depend on a particular package
 apt-cache search {{query}} Search for a package in your current sources
 apt-cache show {{package}} Show information about a package
 apt-get dist-upgrade Upgrade installed packages (like "upgrade"), but remove obsolete packages and install additional packages to meet new dependencies
 apt-get install {{package}} Install a new package
 apt-get remove {{package}} Remove a package
 apt-get update Synchronize list of packages and versions available. This should be run first, before running subsequent apt-get commands
 apt-get upgrade Upgrade installed packages to newest available versions
pindexis commented 8 years ago

does the issue occur on a clean .zshrc ?

kvokka commented 8 years ago

.zshrc

 kvokka@kvokka-PC  ~/proj/volunteers   master  cat ~/.zshrc              ✓  3997  09:11:02 

export TERM="xterm-256color"
# Path to your oh-my-zsh installation.
  export ZSH=/home/kvokka/.oh-my-zsh

# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
# ZSH_THEME="robbyrussell"
ZSH_THEME="powerlevel9k/powerlevel9k"

# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"

# Uncomment the following line to use hyphen-insensitive completion. Case
# sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"

# Uncomment the following line to disable bi-weekly auto-update checks.
# DISABLE_AUTO_UPDATE="true"

# Uncomment the following line to change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13

# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"

# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"

# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"

# Uncomment the following line to display red dots whilst waiting for completion.
# COMPLETION_WAITING_DOTS="true"

# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"

# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# HIST_STAMPS="mm/dd/yyyy"

# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder

# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git vagrant ruby bundler rake rails gem rbenv ubuntu redis-cli knife knife_ssh github)

# User configuration

  export PATH="/usr/local/heroku/bin:/home/kvokka/.rbenv/plugins/ruby-build/bin:/home/kvokka/.rbenv/shims:/home/kvokka/.rbenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
# export MANPATH="/usr/local/man:$MANPATH"

source $ZSH/oh-my-zsh.sh

# You may need to manually set your language environment
# export LANG=en_US.UTF-8

# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
#   export EDITOR='vim'
# else
#   export EDITOR='mvim'
# fi

# Compilation flags
# export ARCHFLAGS="-arch x86_64"

# ssh
# export SSH_KEY_PATH="~/.ssh/dsa_id"

# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"

alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'

export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"

### Added by the Heroku Toolbelt
export PATH="/usr/local/heroku/bin:$PATH"

[[ -s "$HOME/.local/share/marker/marker.sh" ]] && source "$HOME/.local/share/marker/marker.sh"
pindexis commented 8 years ago

can you try to comment source $ZSH/oh-my-zsh.sh I think the error is due to a plugin that is manipulating the stdout output.

kvokka commented 8 years ago
 kvokka@kvokka-PC  ~/proj/bilet18   master ●  cat $ZSH/oh-my-zsh.sh      ✓  4671  23:39:13 
# Check for updates on initial load...
if [ "$DISABLE_AUTO_UPDATE" != "true" ]; then
  env ZSH=$ZSH DISABLE_UPDATE_PROMPT=$DISABLE_UPDATE_PROMPT zsh -f $ZSH/tools/check_for_upgrade.sh
fi

# Initializes Oh My Zsh

# add a function path
fpath=($ZSH/functions $ZSH/completions $fpath)

# Load all stock functions (from $fpath files) called below.
autoload -U compaudit compinit

: ${ZSH_DISABLE_COMPFIX:=true}

# Set ZSH_CUSTOM to the path where your custom config files
# and plugins exists, or else we will use the default custom/
if [[ -z "$ZSH_CUSTOM" ]]; then
    ZSH_CUSTOM="$ZSH/custom"
fi

# Set ZSH_CACHE_DIR to the path where cache files should be created
# or else we will use the default cache/
if [[ -z "$ZSH_CACHE_DIR" ]]; then
  ZSH_CACHE_DIR="$ZSH/cache/"
fi

# Load all of the config files in ~/oh-my-zsh that end in .zsh
# TIP: Add files you don't want in git to .gitignore
for config_file ($ZSH/lib/*.zsh); do
  custom_config_file="${ZSH_CUSTOM}/lib/${config_file:t}"
  [ -f "${custom_config_file}" ] && config_file=${custom_config_file}
  source $config_file
done

is_plugin() {
  local base_dir=$1
  local name=$2
  test -f $base_dir/plugins/$name/$name.plugin.zsh \
    || test -f $base_dir/plugins/$name/_$name
}
# Add all defined plugins to fpath. This must be done
# before running compinit.
for plugin ($plugins); do
  if is_plugin $ZSH_CUSTOM $plugin; then
    fpath=($ZSH_CUSTOM/plugins/$plugin $fpath)
  elif is_plugin $ZSH $plugin; then
    fpath=($ZSH/plugins/$plugin $fpath)
  fi
done

# Figure out the SHORT hostname
if [[ "$OSTYPE" = darwin* ]]; then
  # OS X's $HOST changes with dhcp, etc. Use ComputerName if possible.
  SHORT_HOST=$(scutil --get ComputerName 2>/dev/null) || SHORT_HOST=${HOST/.*/}
else
  SHORT_HOST=${HOST/.*/}
fi

# Save the location of the current completion dump file.
if [ -z "$ZSH_COMPDUMP" ]; then
  ZSH_COMPDUMP="${ZDOTDIR:-${HOME}}/.zcompdump-${SHORT_HOST}-${ZSH_VERSION}"
fi

if [[ $ZSH_DISABLE_COMPFIX != true ]]; then
  # If completion insecurities exist, warn the user without enabling completions.
  if ! compaudit &>/dev/null; then
    # This function resides in the "lib/compfix.zsh" script sourced above.
    handle_completion_insecurities
  # Else, enable and cache completions to the desired file.
  else
    compinit -d "${ZSH_COMPDUMP}"
  fi
else
  compinit -i -d "${ZSH_COMPDUMP}"
fi

# Load all of the plugins that were defined in ~/.zshrc
for plugin ($plugins); do
  if [ -f $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh ]; then
    source $ZSH_CUSTOM/plugins/$plugin/$plugin.plugin.zsh
  elif [ -f $ZSH/plugins/$plugin/$plugin.plugin.zsh ]; then
    source $ZSH/plugins/$plugin/$plugin.plugin.zsh
  fi
done

# Load all of your custom configurations from custom/
for config_file ($ZSH_CUSTOM/*.zsh(N)); do
  source $config_file
done
unset config_file

# Load the theme
if [ "$ZSH_THEME" = "random" ]; then
  themes=($ZSH/themes/*zsh-theme)
  N=${#themes[@]}
  ((N=(RANDOM%N)+1))
  RANDOM_THEME=${themes[$N]}
  source "$RANDOM_THEME"
  echo "[oh-my-zsh] Random theme '$RANDOM_THEME' loaded..."
else
  if [ ! "$ZSH_THEME" = ""  ]; then
    if [ -f "$ZSH_CUSTOM/$ZSH_THEME.zsh-theme" ]; then
      source "$ZSH_CUSTOM/$ZSH_THEME.zsh-theme"
    elif [ -f "$ZSH_CUSTOM/themes/$ZSH_THEME.zsh-theme" ]; then
      source "$ZSH_CUSTOM/themes/$ZSH_THEME.zsh-theme"
    else
      source "$ZSH/themes/$ZSH_THEME.zsh-theme"
    fi
  fi
fi
michaelmoussa commented 8 years ago

@pindexis Funny, I came to report the same issue and ended up solving it for myself. The problem doesn't have anything to do with zsh, as I was encountering the same issue even with a bare .zshrc and sourcing marker.sh directly.

The problem for me was with iTerm2, which I realized when I tried the same thing using the default Mac terminal, where it worked just fine. Upgrading from iTerm 2.1.4 to iTerm 3.0.0 fixed it. I am not sure if that's the same problem @kvokka was having, but I'm sharing anyway in case it helps someone else.

kvokka commented 8 years ago

Thank you, but I'm ubuntu user v 15.10

 kvokka@kvokka-PC  ~/proj/bilet18   master ●  konsole -v                 ✓  4948  19:22:11 
QCoreApplication::arguments: Please instantiate the QApplication object first
Qt: 5.5.1
KDE Frameworks: 5.21.0
Konsole: 15.12.3
pindexis commented 8 years ago

@michaelmoussa ,There is known issue with Iterm. more details here https://github.com/pindexis/marker/issues/5

pindexis commented 8 years ago

@kvokka As I said above, this is probably an issue with some plugins sourced in .zshrc. can you backup the original .zshrc and create a new empty one where you're only sourcing marker.