In zsh shell, I am having the following issue. After I press a command in command prompt, it is repeated in second line and also there's an ineligible character as well.

Command prompt Screen-shot

I run zsh in Guake. Here's my .zshrc:

a TERM="screen-256color"

# install zsh antigen
source /usr/share/zsh-antigen/antigen.zsh

# Load the oh-my-zsh's library.
antigen use oh-my-zsh

# Bundles from the default repo (robbyrussell's oh-my-zsh).
antigen bundle debian
antigen bundle autojump
antigen bundle cp
antigen bundle colorize
antigen bundle command-not-found
antigen bundle git
antigen bundle zsh-users/zsh-syntax-highlighting
# Set Home for VirtualEnvWrapper
export WORKON_HOME="$HOME/.config/virtualenv"
antigen bundle virtualenvwrapper
antigen bundle tmux
antigen bundle littleq0903/gcloud-zsh-completion

# Tell antigen that you're done.
antigen apply

# using system powerline
source /usr/share/powerline/bindings/zsh/powerline.zsh
export MANPAGER="/bin/sh -c \"col -b | vim -c 'set ft=man ts=8 nomod nolist noma' -\""

I started removing line by line to check, which one is causing the issue. I believe its the "antigen use oh-my-zsh".

Another pain point: I tried a lot tmux.conf, but it just didn't work the only thing that worked is this and tmux=tmux -2.

  • 1
    It will most be your terminal configuration – Raman Sailopal Aug 18 '17 at 9:14
  • Probably zsh issues an escape sequence that's not understood by your terminal emulator. Guake is pretty much the only terminal emulator left that's still using an ancient (6 year old) and unmaintained version of VTE (the widget doing the actual terminal emulation). About a dozen other VTE-based terminal emulators all managed to upgrade to use the newest version thereof. I recommend you to consider switching to one of them. – egmont Aug 18 '17 at 10:44
  • I tried the regular emulator, but the issue persists. But the issue is not available in bash. My zshrc is pasted in this link pastebin.com/ZbTemhyi – rafee Aug 18 '17 at 11:02
  • I started removing line by line to check, which one is causing the issue. I believe its the "antigen use oh-my-zsh" – rafee Aug 18 '17 at 11:25
  • 1
    I am absolutely sure now, this is being caused by oh-my-zsh. As my auto completion weren't working with loading oh-my-zsh base, I had to uncomment the line and the issue reappeared. – rafee Aug 18 '17 at 13:59

Those kind of issues arise when something is printing stuff to stdout when they shouldn't, and thus usually messing up either Zsh Line Editor's prompt or the command output. The offending print is probably done from a hook function that the Line Editor runs when a user command is run. You may be able to find the offending print/echo call by searching through the hook function bodies:

whence -f precmd $precmd_functions preexec $preexec_functions

Those are hook functions documented in http://zsh.sourceforge.net/Doc/Release/Functions.html#Hook-Functions.

As mentioned in previous comments, the offending print/echo call is probably a failed attempt to speak with the terminal rather than to print to stdout. Normally I would "if out" the offending line of code by something like:

if [[ $TERM != guake ]]; then
    print -n "\E]..."

but it seems that Guake is not setting the TERM properly. Hopefully you can figure out some other way to detect which terminal is running. Or perhaps just clear/modify those functions and function arrays in your .zshrc.

  • Thank you for the suggestion. But I can't try this anymore as I switched from oh-my-zsh – rafee Sep 14 '17 at 14:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for?Browse other questions tagged or ask your own question.