GNU bug report logs -
#26654
26.0.50; Request to add an option to make emacs not care if input is not coming from tty
Previous Next
To reply to this bug, email your comments to 26654 AT debbugs.gnu.org.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#26654
; Package
emacs
.
(Tue, 25 Apr 2017 14:24:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Kaushal Modi <kaushal.modi <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Tue, 25 Apr 2017 14:24:01 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Hello,
I have a bash script eless ( https://github.com/kaushalmodi/eless ) that I
would like to use to replace 'less' use cases.
I would like to do something like:
echo "foo" | emacs -Q -nw
If I try to do that at the moment, I get
emacs: standard input is not a tty
So this is a feature request to make emacs ignore if standard input is
coming in through another process and not tty. The eless script saves the
input from pipe to a temp file and opens that in "emacs -Q -nw" by default.
So emacs does not need addition of a feature to read directly from STDIN
(as the bash wrapper does it for me).
I have noticed that emacsclient does not care if input is not coming from
tty. So this bug report is to request emacs to behave the same way.
I am calling this a feature request because I see this behavior at least
from emacs 24.3 onwards.
--
Kaushal Modi
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#26654
; Package
emacs
.
(Wed, 26 Apr 2017 10:14:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 26654 <at> debbugs.gnu.org (full text, mbox):
> From: Kaushal Modi <kaushal.modi <at> gmail.com>
> Date: Tue, 25 Apr 2017 14:22:55 +0000
>
> I have a bash script eless ( https://github.com/kaushalmodi/eless ) that I would like to use to replace 'less' use
> cases.
>
> I would like to do something like:
>
> echo "foo" | emacs -Q -nw
>
> If I try to do that at the moment, I get
>
> emacs: standard input is not a tty
>
> So this is a feature request to make emacs ignore if standard input is coming in through another process and
> not tty. The eless script saves the input from pipe to a temp file and opens that in "emacs -Q -nw" by default.
> So emacs does not need addition of a feature to read directly from STDIN (as the bash wrapper does it for
> me).
Then why not do something like below instead?
echo "foo" && emacs -Q -nw
IOW, I don't understand what is the significance of the pipe in this
command.
> I have noticed that emacsclient does not care if input is not coming from tty.
The client doesn't interact with the user, it only instructs the
server to visit the file. Emacs, OTOH, does need to interact.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#26654
; Package
emacs
.
(Wed, 26 Apr 2017 17:09:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 26654 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On Wed, Apr 26, 2017 at 6:13 AM Eli Zaretskii <eliz <at> gnu.org> wrote:
>
> Then why not do something like below instead?
>
> echo "foo" && emacs -Q -nw
>
Well, my example was too simplified; I do care that "foo" gets into the
emacs buffer, just not "how". At the moment emacs does not accept input
from STDIN in non-batch mode. So I use a wrapper script (
https://raw.githubusercontent.com/kaushalmodi/eless/master/eless ) to save
the STDIN into a temp file and then open that temp file in emacs.
> IOW, I don't understand what is the significance of the pipe in this
> command.
>
The "man grep" is the best example.. I cannot control how man calls the
$PAGER. If I set $PAGER as eless, man eventually does something like "blah
blah | $PAGER".
The common use cases for eless are as follows:
eless foo.txt # Open foo.txt in eless in terminal
(-nw) mode by default.
eless foo.txt -gui # Open foo.txt in eless in GUI mode.
echo 'foo' | eless #
echo 'foo' | eless - # Same as above. The hyphen after eless
does not matter; is anyways discarded.
grep 'bar' foo.txt | eless #
PAGER=eless man grep # Launches man pages in eless (terminal
mode), if the environment variable PAGER is set to eless.
PAGER=eless man grep -gui # Launches man pages in eless (GUI
mode), if the environment variable PAGER is set to eless.
diff foo bar | eless # Colored diff!
eless . # Open dired in the current directory
(enhanced 'ls')
eless -h | eless # See eless help ;-)
> I have noticed that emacsclient does not care if input is not coming from
> tty.
>
> The client doesn't interact with the user, it only instructs the
> server to visit the file. Emacs, OTOH, does need to interact.
>
That's alright, at the minimum it would be nice to have emacs not error out
if it detects input coming from STDIN.. it does not have to worry, the bash
script will take care of that (The best case if ofcourse if emacs can read
in STDIN in non-batch mode too).
For now, we use a workaround in eless that always starts emacs in a new
sub-shell and that way the sub-shelled emacs always "thinks" that it not
receiving anything from the stdin. But would like to get away from this
limitation.
--
Kaushal Modi
[Message part 2 (text/html, inline)]
This bug report was last modified 8 years and 53 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.