You are not logged in.

#1 2015-01-09 14:59:31

Lerp
Member
Registered: 2014-03-05
Posts: 35

[Solved] zsh and urxvt repeating command

I am using zsh and urxvt and whenever I type a command, the command is repeated like so:

╭─james@pc  ~  
╰─$ test
test%

It's not annoying for the example above, but for commands with output, it doesn't put a new line after the command, so for example, a command like ls:

╭─james@pc  ~  
╰─$ ls
lsDesktop  dotfiles  Downloads  pictures  projects  revision  scripts

I cannot work out what is causing it, let alone how to stop it.

One thing I did notice, it will print the command once for every time I haved sourced my zshrc in the current terminal's lifetime. It's a bit easier to show than explain:

╭─james@pc  ~  
╰─$ echo "fresh"
echofresh
╭─james@pc  ~  
╰─$ source .zshrc
source%
╭─james@pc  ~  
╰─$ echo "once"
echoechoonce
╭─james@pc  ~  
╰─$ source .zshrc
sourcesource%
╭─james@pc  ~  
╰─$ echo "twice"
echoechoechotwice

Here's my zshrc, if you need any other information please ask.

# Options
HISTFILE=~/.histfile
HISTSIZE=1000
SAVEHIST=1000
ZSH=/usr/share/oh-my-zsh/
ZSH_THEME="bira"
DISABLE_AUTO_UPDATE="true"
plugins=(git)

setopt noflowcontrol
setopt appendhistory extendedglob
unsetopt beep nomatch notify

# Keybindings
typeset -g -A key

bindkey '^?'    backward-delete-char    # Backspace
bindkey '^[[2~' overwite-mode           # Insert
bindkey '^[[3~' delete-char             # Delete
bindkey '^[[7~' beginning-of-line       # Home
bindkey '^[[8~' end-of-line             # End
bindkey '^S'    insert-sudo

# Vars
export EDITOR="gvim"
export JAVA_HOME=/usr/lib/jvm/java-7-jdk/jre/
export USER_SCRIPTS=$HOME/dotfiles/scripts
export PATH=$PATH:$USER_SCRIPTS

# Colours
export WHITE=#C5C8C6
export BLACK=#1D1F21
export DARK_GRAY=#373B41
export LIGHT_GRAY=#969896
export RED=#CC6666
export ORANGE=#DE935F
export YELLOW=#F0C674
export GREEN=#B5BD68
export AQUA=#8ABEB7
export BLUE=#81A2BE
export PURPLE=#B294BB

# Misc
# Function for inserting sudo at the start of the line
insert_sudo() {
    if [[ $BUFFER != "sudo "* ]]; then
        BUFFER="sudo $BUFFER"
        CURSOR+=5
    fi
}

zle -N insert-sudo insert_sudo

# Hooks
source /usr/share/doc/pkgfile/command-not-found.zsh
source /usr/share/oh-my-zsh/oh-my-zsh.sh

Last edited by Lerp (2015-01-10 19:45:04)

Offline

#2 2015-01-09 15:48:22

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: [Solved] zsh and urxvt repeating command

And with a different zshrc do you see this happen?  If not, just start subdividing your zshrc until you figure out which line causes the problem.

Your prompt isn't set there, where do you set the prompt?


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2015-01-09 16:10:23

Lerp
Member
Registered: 2014-03-05
Posts: 35

Re: [Solved] zsh and urxvt repeating command

Trilby wrote:

Your prompt isn't set there, where do you set the prompt?

It's set in the zsh theme file, I tried several different themes and it happens with any.

Offline

#4 2015-01-09 16:47:25

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: [Solved] zsh and urxvt repeating command

Ok.  What about the rest of my post?


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#5 2015-01-09 17:12:59

ANOKNUSA
Member
Registered: 2010-10-22
Posts: 2,141

Re: [Solved] zsh and urxvt repeating command

I've seen this behavior when locale and/or terminfo settings are incorrect. A couple ideas:

- See if this persists when using Bash. If it does, it's probably the terminfo settings.
- See if this persists when not using Oh My Zsh, or maybe just move your ~/.zshrc to ~/.zshrc_bak. If not using Oh My Zsh clears things up, then OMZ might be setting some environment variable that's causing the problem.

In each case, check the output of "locale" and "echo $TERM:"

 » locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_ALL=
                                                                               
 » echo $TERM
rxvt-unicode-256color

Offline

#6 2015-01-09 19:41:08

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [Solved] zsh and urxvt repeating command

Oh-my-zsh is an excruciating ratmangle in terms of both concept and execution; installing it is a recipe for exactly this sort of brokeness and bewilderment.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#7 2015-01-10 15:21:33

Lerp
Member
Registered: 2014-03-05
Posts: 35

Re: [Solved] zsh and urxvt repeating command

Trilby wrote:

Ok.  What about the rest of my post?

Sorry got side tracked.

ANOKNUSA wrote:

- See if this persists when using Bash. If it does, it's probably the terminfo settings.

Everything works fine when I use bash.

ANOKNUSA wrote:

- See if this persists when not using Oh My Zsh, or maybe just move your ~/.zshrc to ~/.zshrc_bak. If not using Oh My Zsh clears things up, then OMZ might be setting some environment variable that's causing the problem.

I disabled the oh-my-zsh hook and it stopped so it definitely is oh-my-zsh.

I was only using it for the themes so I'm happy to not use it. For completeness here's my $TERM and locale output.

pc% echo $TERM
screen-256color
pc% locale
LANG=en_GB.UTF-8
LC_CTYPE="en_GB.UTF-8"
LC_NUMERIC="en_GB.UTF-8"
LC_TIME=en_GB.UTF-8
LC_COLLATE="en_GB.UTF-8"
LC_MONETARY="en_GB.UTF-8"
LC_MESSAGES="en_GB.UTF-8"
LC_PAPER="en_GB.UTF-8"
LC_NAME="en_GB.UTF-8"
LC_ADDRESS="en_GB.UTF-8"
LC_TELEPHONE="en_GB.UTF-8"
LC_MEASUREMENT="en_GB.UTF-8"
LC_IDENTIFICATION="en_GB.UTF-8"
LC_ALL=

Offline

#8 2015-01-10 18:03:36

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [Solved] zsh and urxvt repeating command

Please remember to mark your thread as [Solved] by editing your first post and prepending it to the title.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#9 2022-06-22 14:27:15

knifemaster007
Member
Registered: 2022-06-22
Posts: 1
Website

Re: [Solved] zsh and urxvt repeating command

Sorry for necroposting, recently I encountered same problem. I've solved it without disabled oh-my-zsh plugin. Setting URxvt*termName to 'rxvt' helped

Offline

#10 2022-06-22 14:40:23

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 23,430

Re: [Solved] zsh and urxvt repeating command

Closing this old thread.

Offline

Board footer

Powered by FluxBB