Strange character inserted before result of each command #1338

Closed
slhck opened this Issue Oct 1, 2012 · 13 comments

Comments

Projects
None yet
10 participants
@slhck

slhck commented Oct 1, 2012

I use the latest oh-my-zsh from today with zsh 4.3.17, just installed via curl on Ubuntu 12.04 with GNOME Terminal. Whenever I run a command, a strange character is printed before the result:

werner@satyr:~/.oh-my-zsh% ls
�klscustom  lib  log  oh-my-zsh.sh  plugins  README.textile  templates  themes  tools

Actually, the real output should start at custom, not with kls. Here's a screenshot:

The full .zshrc I use is here. Everything works fine without oh-my-zsh, but as soon as I source it, I get the problem mentioned above. Note that I primarily use this zshrc on OS X, but it has worked on Linux before.

Let me know if there is more information needed to get to the root of this issue.

@fuadsaud

This comment has been minimized.

Show comment Hide comment
@fuadsaud

fuadsaud Oct 1, 2012

Contributor

Don't know if it's related, but running something like this I got a strange output

for a inlsdo; echo $a; done

Strange output

Contributor

fuadsaud commented Oct 1, 2012

Don't know if it's related, but running something like this I got a strange output

for a inlsdo; echo $a; done

Strange output

@har5ha

This comment has been minimized.

Show comment Hide comment
@har5ha

har5ha Oct 11, 2012

I am having the same problem on Mac OSX Terminal App, although it works properly on iTerm2.

% ls
lsApplications Dropbox Library
^

Every command I enter gets echoed/printed on the first line of the output in the above case "ls"Applications

Another example..

% man ls
manLS(1) BSD General Commands Manual LS(1)
^^^
.....

har5ha commented Oct 11, 2012

I am having the same problem on Mac OSX Terminal App, although it works properly on iTerm2.

% ls
lsApplications Dropbox Library
^

Every command I enter gets echoed/printed on the first line of the output in the above case "ls"Applications

Another example..

% man ls
manLS(1) BSD General Commands Manual LS(1)
^^^
.....

@har5ha

This comment has been minimized.

Show comment Hide comment
@har5ha

har5ha Oct 12, 2012

I was able to get rid of the problem by commenting out the following line as I have ( export TERM="screen-256color") in my .zshrc

File Name : ~/.oh-my-zsh/lib/termsupport.zsh

#print -Pn "\ek$1:q\e" #set screen hardstatus, usually truncated at 20 chars

har5ha commented Oct 12, 2012

I was able to get rid of the problem by commenting out the following line as I have ( export TERM="screen-256color") in my .zshrc

File Name : ~/.oh-my-zsh/lib/termsupport.zsh

#print -Pn "\ek$1:q\e" #set screen hardstatus, usually truncated at 20 chars

@patrickod

This comment has been minimized.

Show comment Hide comment
@patrickod

patrickod Sep 27, 2013

I know this thread is over a year old but was this ever resolved? I'm still seeing it today on Ubuntu 13.04.

I know this thread is over a year old but was this ever resolved? I'm still seeing it today on Ubuntu 13.04.

@har5ha

This comment has been minimized.

Show comment Hide comment
@har5ha

har5ha Sep 30, 2013

@patrickod Nope.

har5ha commented Sep 30, 2013

@patrickod Nope.

@patrickod

This comment has been minimized.

Show comment Hide comment
@patrickod

patrickod Sep 30, 2013

@har5ha hmm that's a shame. Thankfully your fix has worked for me in the meantime.

@har5ha hmm that's a shame. Thankfully your fix has worked for me in the meantime.

@slhck

This comment has been minimized.

Show comment Hide comment
@slhck

slhck Nov 1, 2013

I think the root cause is setting the TERM environmental variable to screen (or a variation thereof) when you're actually not using screen.

It didn't matter on OS X, but on Linux terminals, I was able to reproduce the issue. Thus, closed as not really a bug.

slhck commented Nov 1, 2013

I think the root cause is setting the TERM environmental variable to screen (or a variation thereof) when you're actually not using screen.

It didn't matter on OS X, but on Linux terminals, I was able to reproduce the issue. Thus, closed as not really a bug.

@slhck slhck closed this Nov 1, 2013

@rolfschr

This comment has been minimized.

Show comment Hide comment
@rolfschr

rolfschr Jan 22, 2014

Actually, just uncomment DISABLE_AUTO_TITLE="true" in ~/.zshrc (if you don't care about titles) in order to "fix" the problem.

Actually, just uncomment DISABLE_AUTO_TITLE="true" in ~/.zshrc (if you don't care about titles) in order to "fix" the problem.

@joseronierison

This comment has been minimized.

Show comment Hide comment
@joseronierison

joseronierison Dec 20, 2014

I have the same problem
Using Debian 7.7
I try to uncomemment DISABLE_AUTO_TITLE="true", and it don't works.

http://prntscr.com/5j4sc1

I have the same problem
Using Debian 7.7
I try to uncomemment DISABLE_AUTO_TITLE="true", and it don't works.

http://prntscr.com/5j4sc1

@mcornella

This comment has been minimized.

Show comment Hide comment
@mcornella

mcornella Dec 21, 2014

Collaborator

Try installing powerline fonts. See agnoster.zsh-theme file for more
information.

Marc

Collaborator

mcornella commented Dec 21, 2014

Try installing powerline fonts. See agnoster.zsh-theme file for more
information.

Marc

@liangguohuan

This comment has been minimized.

Show comment Hide comment
@liangguohuan

liangguohuan Feb 8, 2015

@rolfschr thanks. this is helpful.
ubuntu 14.04 is the same problom.

@rolfschr thanks. this is helpful.
ubuntu 14.04 is the same problom.

@axyz axyz referenced this issue in sindresorhus/pure May 16, 2015

Closed

Command name printed right after command execution #113

@flakrat

This comment has been minimized.

Show comment Hide comment
@flakrat

flakrat May 12, 2016

Ha, I feel like an idiot. I was having this issue when using gnome-terminal and completely forgot to set the fonts in the Gnome Terminal profile prefs to use a Powerline font. Grr....

# If running in Gnome Terminal, set the default profile font to Powerline and background color
if [ ${VTE_VERSION+x} ]; then
  profile="$(gconftool-2 --get /apps/gnome-terminal/global/default_profile)"

  oldbkcolor="$(gconftool-2 --get /apps/gnome-terminal/profiles/${profile}/background_color)"
  newbkcolor='#00002B2B3636'
  echo "Changing gnome-terminal ${profile} profile background_color from '$oldbkcolor' to '$newbkcolor'"
  gconftool-2 --set /apps/gnome-terminal/profiles/${profile}/background_color --type string "$newbkcolor"

  oldfont="$(gconftool-2 --get /apps/gnome-terminal/profiles/${profile}/font)"
  newfont="Meslo LG M DZ for Powerline 8"

  echo "Changing gnome-terminal ${profile} profile font from: '$oldfont' to '$newfont'"
  gconftool-2 --set /apps/gnome-terminal/profiles/${profile}/use_system_font --type bool false
  gconftool-2 --set /apps/gnome-terminal/profiles/${profile}/font --type string "$newfont"
fi

flakrat commented May 12, 2016

Ha, I feel like an idiot. I was having this issue when using gnome-terminal and completely forgot to set the fonts in the Gnome Terminal profile prefs to use a Powerline font. Grr....

# If running in Gnome Terminal, set the default profile font to Powerline and background color
if [ ${VTE_VERSION+x} ]; then
  profile="$(gconftool-2 --get /apps/gnome-terminal/global/default_profile)"

  oldbkcolor="$(gconftool-2 --get /apps/gnome-terminal/profiles/${profile}/background_color)"
  newbkcolor='#00002B2B3636'
  echo "Changing gnome-terminal ${profile} profile background_color from '$oldbkcolor' to '$newbkcolor'"
  gconftool-2 --set /apps/gnome-terminal/profiles/${profile}/background_color --type string "$newbkcolor"

  oldfont="$(gconftool-2 --get /apps/gnome-terminal/profiles/${profile}/font)"
  newfont="Meslo LG M DZ for Powerline 8"

  echo "Changing gnome-terminal ${profile} profile font from: '$oldfont' to '$newfont'"
  gconftool-2 --set /apps/gnome-terminal/profiles/${profile}/use_system_font --type bool false
  gconftool-2 --set /apps/gnome-terminal/profiles/${profile}/font --type string "$newfont"
fi
@jenguidanos

This comment has been minimized.

Show comment Hide comment
@jenguidanos

jenguidanos Feb 23, 2017

I get on this today. The problem starts after set "export TERM="screen-256color"" on .zshrc. Enable DISABLE_AUTO_TITLE="true" has resolved the problem to me (thanks @joseronierison)

I get on this today. The problem starts after set "export TERM="screen-256color"" on .zshrc. Enable DISABLE_AUTO_TITLE="true" has resolved the problem to me (thanks @joseronierison)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment