3

I'm facing a weird problem; whenever I run a command in eshell (wether it is a simple command, a complex application or a toy example) every output which should go towards stderr goes to stdout instead.

This is an example:

#include <iostream>

int main()
{
   std::cerr << "ERROR\n";
   std::cout << "OUTPUT\n";

}

I get the following:

~ $ ./a.out 2> /dev/null
ERROR
OUTPUT

Launching the same command with shell, term or an external terminal works as expected. Even launching either dash, sh or bash inside eshell and then launching the program works.

Is this an eshell bug? Could it be some wrong configuration from my side? My emacs version is GNU Emacs 24.3.1

Thank you, Nikolas

bznein
  • 908
  • 7
  • 21
  • 1
    Seems like an eshell bug. Eshell's *info* has a section on redirection, but stderr isn't mentioned there at all. – choroba Oct 02 '15 at 11:22

1 Answers1

0

From the Eshell documentation:

1.2 What Eshell is not

Eshell is not a replacement for system shells such as bash or zsh. Use Eshell when you want to move text between Emacs and external processes; if you only want to pipe output from one external process to another (and then another, and so on), use a system shell, because Emacs’s IO system is buffer oriented, not stream oriented, and is very inefficient at such tasks. If you want to write shell scripts in Eshell, don’t; either write an elisp library or use a system shell.

Some things Eshell just doesn’t do well. It fills the niche between IELM and your system shell, where the peculiar use-cases lie, and it is less than ideal outside that niche.

That would be enough to scare me away from using it in favor of bash or zsh.

Community
  • 1
  • 1
msw
  • 42,753
  • 9
  • 87
  • 112