all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tassilo Horn <tsdh@gnu.org>
To: Aidan Gauland <aidalgol@amuri.net>
Cc: emacs-devel@gnu.org
Subject: Re: Eshell visual commands with redirection bug
Date: Mon, 10 Jun 2013 09:21:03 +0200	[thread overview]
Message-ID: <87fvwqig80.fsf@thinkpad.tsdh.de> (raw)
In-Reply-To: <87li6i68ul.fsf@dimension8.tehua.net> (Aidan Gauland's message of "Mon, 10 Jun 2013 13:41:06 +1200")

Aidan Gauland <aidalgol@amuri.net> 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 -> horn@thinkpad.tsdh.de.20902:1362908452
>>
>> but horn@thinkpad.tsdh.de.20902: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 <horn@uni-koblenz.de>
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 <horn@uni-koblenz.de>
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 <horn@uni-koblenz.de>
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 <horn@uni-koblenz.de>
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	other threads:[~2013-06-10  7:21 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-31 10:58 [Eshell patch] Visual subcommands and options Tassilo Horn
2013-06-01  9:49 ` Tassilo Horn
2013-06-01 21:41 ` Aidan Gauland
2013-06-02  9:28   ` Tassilo Horn
2013-06-03  0:11     ` Aidan Gauland
2013-06-03  7:15       ` Tassilo Horn
2013-06-03 20:04         ` Aidan Gauland
     [not found]           ` <87hahel63t.fsf_-_@thinkpad.tsdh.de>
2013-06-07  3:56             ` Some more eshell problems Aidan Gauland
2013-06-07 11:38               ` Tassilo Horn
2013-06-07 12:39                 ` Thierry Volpiatto
2013-06-07 16:25                   ` Tassilo Horn
2013-06-09  7:07         ` Eshell visual commands with redirection bug Aidan Gauland
2013-06-09  9:47           ` Tassilo Horn
2013-06-10  1:41             ` Aidan Gauland
2013-06-10  7:21               ` Tassilo Horn [this message]
2013-06-10  8:20                 ` Aidan Gauland

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fvwqig80.fsf@thinkpad.tsdh.de \
    --to=tsdh@gnu.org \
    --cc=aidalgol@amuri.net \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.