help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Optimal emacs shell for coding


From: Rupert Swarbrick
Subject: Re: Optimal emacs shell for coding
Date: Tue, 12 Aug 2008 21:08:36 +0100
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.2 (gnu/linux)

>>> 
>>> >> ~/web/emacs $ which grep
...
>>> >> emacs_n_unicode.html                        xah_emacs_linkify.el~
>>> >> ~/web/emacs $
...
>>> >
>>> >
>>> > Why do you think predictable behaviour is nice? ;-)
>>> >
>>> > Ok, you discovered the bug so it is your turn to file a bug report again 
>>> > ...
>>> 
>>> don't think its a bug. This is eshell not handling redirection correclty
>>> and is something that cannot be easily fixed. Bottom line, don't use
>>> redirection in eshell.
>>
>> FWIW, I don't see anything wrong with the above: just unwrap the
>> obviously wrapped lines, and you will see that everything is
>> honky-dory.
>
> But it's different from how bash + ls behave in a "normal" terminal.
> When stdout for the `ls' command is not a tty it prints one file per
> line (IMHO the right way).
>
> David

Well, I just dug out coreutils' sources. In ls.c, line 1423 in the
function decode_switches, the magic reveals itself:

  switch (ls_mode)
    {
    case LS_MULTI_COL:
      /* This is for the `dir' program.  */
      format = many_per_line;
      set_quoting_style (NULL, escape_quoting_style);
      break;

    case LS_LONG_FORMAT:
      /* This is for the `vdir' program.  */
      format = long_format;
      set_quoting_style (NULL, escape_quoting_style);
      break;

    case LS_LS:
      /* This is for the `ls' program.  */
      if (isatty (STDOUT_FILENO))
        {
          format = many_per_line;
          /* See description of qmark_funny_chars, above.  */
          qmark_funny_chars = true;
        }
      else
        {
          format = one_per_line;
          qmark_funny_chars = false;
        }
      break;

    default:
      abort ();
    }
(If my gnus-foo worked, otherwise I'll post the snippet in a sec)

Presumably, isatty(STDOUT_FILENO) is returning true for some reason when
called under eshell?

Rupert

Attachment: pgp4rUgvw73Ky.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]