Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Many days ago, the zsh of my Arch Linux did what I want: if I entered `xsel` and pressed Tab, it would be replaced by the output of xsel. Now, on the same box, I get this:

xsel: fstat error on stdin: Bad file descriptor

What's more strange, I have setup another Arch Linux now, with the same zsh and config files. It just does this expansion right.

I write a simple script a to discover what happens to the stdin:

echo $(readlink /proc/self/fd/0)

Let's try again---`./a`, and press Tab. On the former box, I get


and on the latter which is what I want:


What should I do further to find out why they are different and get the expansion right?

share|improve this question

I finally find out that this is caused by this zsh-history-substring-search script sosurced from my .zshrc when available. I still don't know why this happens, but I've opened an issue for this.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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