emacs-devel
[Top][All Lists]
Advanced

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

Re: Eshell visual commands with redirection bug


From: Tassilo Horn
Subject: Re: Eshell visual commands with redirection bug
Date: Mon, 10 Jun 2013 09:21:03 +0200
User-agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.50 (gnu/linux)

Aidan Gauland <address@hidden> writes:

>>>> So eshell should ignore a command's "visuality" if its output is
>>>> redirected.
>>>
>>> Done!  Should be fixed in 112898.  Let me know if you have any
>>> problems (as usual).
>>
>> Redirection still doesn't work, but now it fails differently. ;-)
>>
>>   $ git diff
>>
>> shows the diff visually as it's supposed to do with my configs.  Now
>> when I do
>>
>>   $ git diff > my.patch
>>
>> I don't see the diff visually as I did before your changes (good), but
>> the command also doesn't finish.  Using an external terminal, I can see
>> that now there's a symlink
>>
>>     .#my.patch -> address@hidden:1362908452
>>
>> but address@hidden:1362908452 doesn't exist.
>>
>> All I can do is `C-c C-k' to kill the process.
>
> Sorry, I cannot reproduce this problem.  I am running GNU Emacs 24.3.1
> from Debian, and Eshell from trunk, on Debian wheezy.  Which Emacs
> version and OS are you running?

I'm running Emacs from bzr (the last 2 commits are yours) on a
GNU/Gentoo box.  Here's a recipe that works for me.

1. emacs -Q
2. In *scratch*, evaluate
   (setq eshell-visual-commands (append eshell-visual-commands '("htop"))
         eshell-visual-subcommands '(("git" "log" "show" "diff" "help")
                                     ("bzr" "log" "show" "diff" "help"))
         eshell-visual-options '(("git" "--help")))
3. M-x eshell RET
4. cd /path/to/some/git/repo
5. git log > glog.txt
6. Command doesn't return

What I can see is that this command creates a symlink .#glog.txt as I've
written before.  When I hit RET, I get an additional #glog.txt# file
that contains the first page of "git log" output:

--8<---------------cut here---------------start------------->8---
WARNING: terminal is not fully functional
^M-  (press RETURN)^M^Mcommit de57d853dc2818d34cc1257c1b191ea963c20027
Author: Tassilo Horn <address@hidden>
Date:   Thu Jun 6 13:57:15 2013 +0200

    Added rule application HOFs all and any to in-place.

[...]

lines 1-32
--8<---------------cut here---------------end--------------->8---

When I hit RET a few times, it doesn't seem to change anything (except
for putting newlines in eshell).  But when I hit `q RET', the command
finally finishes and the #glog.txt# file becomes glog.txt.  The contents
are:

--8<---------------cut here---------------start------------->8---
WARNING: terminal is not fully functional
^M-  (press RETURN)^M^Mcommit de57d853dc2818d34cc1257c1b191ea963c20027
Author: Tassilo Horn <address@hidden>
Date:   Thu Jun 6 13:57:15 2013 +0200

    Added rule application HOFs all and any to in-place.

[...]

lines 1-32^Mcommit a069c9ad8ee941e7bdeca394cf201fcfd40c4867
lines 2-33^MAuthor: Tassilo Horn <address@hidden>
lines 3-34^MDate:   Fri May 31 17:41:17 2013 +0200
lines 4-35^M
lines 5-36^M    Some updates and use flatland.ordered.
lines 6-37^M
lines 7-38^Mcommit d9d44aa2f57a23e938a58286dd829d05fbfa5786
lines 8-39^MAuthor: Tassilo Horn <address@hidden>
lines 9-40^MDate:   Mon May 6 11:28:02 2013 +0200
lines 10-41^M
lines 11-42^M    ...
lines 12-43^M
--8<---------------cut here---------------end--------------->8---

With ZSH, I get output like that when issuing

  $ TERM=dumb git log

without a redirection.  But with redirection, the log is just dumped
into a file.

I think the problem is that git uses isatty(3) to detect if its output
is piped or redirected.  If so, then it's just dumped, else it's
paginated.  So probably redirections in eshell can't be detected with
isatty, right?

Bye,
Tassilo



reply via email to

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