unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Alex Hutcheson <alexhutcheson@google.com>
To: Glenn Morris <rgm@gnu.org>
Cc: 25496@debbugs.gnu.org
Subject: bug#25496: 25.1.91; INSIDE_EMACS env variable is not set in eshell
Date: Mon, 23 Jan 2017 15:36:17 -0500	[thread overview]
Message-ID: <CACjgaUdx_+dE4AYBaj2YGHROY6L7wQnKaLwfWGePUuusFfOnLg@mail.gmail.com> (raw)
In-Reply-To: <9937g934vi.fsf@fencepost.gnu.org>

> Could you give some examples of where this matters?
> It never has been set for eshell, AFAIK.

Here's the case I'm running into:
Some command line programs that I work with (version control systems, as
well as other scripts) allow the user to specify a merge tool that gets called
for merge conflicts. I prefer to use ediff as my merge tool, so I have a simple
bash script that launches emacsclient and calls ediff with the appropriate
arguments.

My desired behavior is this:
if INSIDE_EMACS:
  Run an ediff session within the existing Emacs instance
else:
  Create a new frame and launch the ediff session in that

I frequently work by SSHing into my workstation and using emacsclient to
connect to the Emacs instance running on the workstation. I run all my shell
commands in M-x shell or eshell. If I run `emacsclient -c' in one of
these shells,
it creates a graphical frame on my workstation's desktop, which I can't see over
SSH. Instead, I check for INSIDE_EMACS, and if I detect that my shell is running
within Emacs I call emacsclient without -c.


On Mon, Jan 23, 2017 at 3:20 PM, Glenn Morris <rgm@gnu.org> wrote:
> Alex Hutcheson wrote:
>
>> The INSIDE_EMACS environmental variable is set for comint processes,
>> including M-x shell and ansi-term. However, it's not set for eshell or
>> for processes launched by eshell. This makes it difficult for scripts to
>> detect whether or not they are being run inside eshell.
>
> Could you give some examples of where this matters?
> It never has been set for eshell, AFAIK.
>
> When I think of INSIDE_EMACS usage, the only thing that comes to mind is
> interactive bash, which obviously isn't relevant for eshell (as a bash
> replacement).
>
>> The INSIDE_EMACS env variable should be set within eshell, or should at
>> least be set for processes launched by eshell.



-- 
Alex Hutcheson
alexhutcheson@google.com





  reply	other threads:[~2017-01-23 20:36 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-20 22:32 bug#25496: 25.1.91; INSIDE_EMACS env variable is not set in eshell Alex Hutcheson
2017-01-23 20:20 ` Glenn Morris
2017-01-23 20:36   ` Alex Hutcheson [this message]
2020-03-08 16:50 ` Federico Tedin
2020-03-28 15:05   ` Federico Tedin
2020-03-29  0:21   ` Noam Postavsky
2020-03-29 22:29     ` Federico Tedin
2020-03-30  1:44       ` Noam Postavsky
2020-03-30 19:52         ` Federico Tedin
2020-03-30 23:11           ` Noam Postavsky
2020-04-02 23:06             ` Noam Postavsky
2020-04-03 12:17             ` Eli Zaretskii
2020-04-04 10:08               ` Federico Tedin
2020-04-11  9:20                 ` Eli Zaretskii

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=CACjgaUdx_+dE4AYBaj2YGHROY6L7wQnKaLwfWGePUuusFfOnLg@mail.gmail.com \
    --to=alexhutcheson@google.com \
    --cc=25496@debbugs.gnu.org \
    --cc=rgm@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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).