I recently migrated all my dotfiles and setting to a new laptop running Ubuntu 13.04, and have been noticing a strange behavior that I've never seen before. Essentially, it seems like my terminal is sometimes trying to parse commands from right to left rather than the normal way. Its not consistant at all, and often typing the same command twice will produce different output.


 ⋯  www  localwork  cd ~/Downloads
bash: /home/goldenapples/Downloads: Is a directory

 ~  cd ~/Downloads
 ~  Downloads  ls

So, the first command seems to have been parsed as cd ~; Downloads, but the second time I typed the same exact command, it worked fine.

The same thing happens with aliases. Here I have gp aliased to git push:

 ~  Documents  infostats-theme   master  gp
usage: git [--version] [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           [-c name=value] [--help]
           <command> [<args>]


See 'git help <command>' for more information on a specific command.
The program 'push' is currently not installed. You can install it by typing:
sudo apt-get install heimdal-clients

 ~  Documents  infostats-theme   master  gp
Counting objects: 22, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (14/14), done.
Writing objects: 100% (14/14), 1.69 KiB, done.
Total 14 (delta 12), reused 0 (delta 0)
To [email protected]:janrain/statboard.git
   cf86529..3208e21  HEAD -> master:wq

No idea what happened there. My bash aliases were processed in the first example, and it correctly read the line as git push, but I don't knwo what happened after that. Looks like it tried to parse the command as git; push; and so it showed the git help screen, and then displayed an error that no program named push was installed. The werid thing is: typing the same exact command immediately afterwards worked fine.

This is one of those problems I've just been putting up with because it makes no sense. The only thing I can seem to pinpoint is that the problem behavior seems to happen when I'm typing especially fast, and slowing down and retyping the command sometimes makes it work.

I'm mostly using Bash inside of tmux 1.8, if that lends any help.


Adding this line to my .tmux.conf:

set-option -g default-command "exec /bin/bash --norc"

seems to have fixed the problem... or at least I haven't been able to cause it again since. But I still have no idea why or how, and I'd love an explanation.

  • 1
    Does it happen in bash --norc? Does it happen if you move ~/.inputrc outi of the way? Does it happen outside tmux? Commented Aug 20, 2013 at 23:05
  • I haven't been able to reproduce it outside of tmux... its a very intermittent problem, so I'm not sure that it is tmux-related, but that's a definite possibility. Commented Aug 21, 2013 at 16:30
  • 1
    If skipping your .bashrc fixes the issue, then it's something there causing it. So post your .bashrc. Given that the bug comes up inside an alias, I think this has to be a bug in bash. Hmmm… does the bug survive a reboot? Have you run a memory test recently (pick memtest at the Grub prompt and let stew overnight)? Commented Aug 21, 2013 at 16:45

2 Answers 2


It looks like something is parsing spaces as returns.

Can you remove tmux from the situation (try working in a console or virtual terminal)?

Also, check the setting of IFS, thus:

$ echo ":$IFS:" | cat -vte
: ^I$

(so, SPace, TAB, Return).

Are any other of the problem commands aliased or implemented as functions of the same name as a command?

Try '\cd ...' or 'command cd' to work around.

Also, for diagnosis, try using the TAB key for intra-command white space instead of SPace, and/or the Line Feed (Ctrl-J) instead of Return (Ctrl-M).


To debug such issues you can try to turn on printing of command and input lines the bash is processing during the parsing of an input:

set -v -x

To turn it off again you can use set +v +x. Sometimes quite weird things are happening in the background.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .