Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot make commits when Emacs is running in a terminal #786

Closed
skeeto opened this issue Aug 20, 2013 · 7 comments
Closed

Cannot make commits when Emacs is running in a terminal #786

skeeto opened this issue Aug 20, 2013 · 7 comments
Milestone

Comments

@skeeto
Copy link

skeeto commented Aug 20, 2013

Maybe this was recent intentional change, but magit is now trying to launch a separate editor for entering commit messages rather than accept it in a buffer like before. This completely fails in a non-gui environment and many other setups.

To demonstrate, run this in the magit source repository:

DISPLAY='' emacs -Q -L . -l magit.el

Try to make a commit and magit attempts to launch a terminal version of emacsclient within Emacs, which fails:

$ git --no-pager commit
Waiting for Emacs...
*ERROR*: Terminal type "dumb" is not powerful enough to run Emacs
error: There was a problem with the editor '/usr/bin/emacsclient'.
Please supply the message using either -m or -F option.
git exited abnormally with code 1.

Edit: I see now that #675 and 6142abf is what lead to this new behavior. As it stands right now, magit no longer supports terminal Emacs.

@praet
Copy link
Contributor

praet commented Aug 21, 2013

On Tue, 20 Aug 2013 10:40:27 -0700, Christopher Wellons notifications@github.com wrote:

Maybe this was recent intentional change, but magit is now trying to
launch a separate editor for entering commit messages rather than
accept it in a buffer like before. This completely fails in a non-gui
environment and many other setups.
[...]

Works here, both from X using DISPLAY='' and from a TTY, running
Magit with `magit-git-editor' == t (making ${,GIT}EDITOR irrelevant).

However I could trigger the issue in two cases:

  • setting `magit-git-editor' to "emacs -nw"
  • setting ${,GIT}EDITOR to "emacs -nw" and `magit-git-editor' to 'any

You don't happen to be using such a configuration?

Peace

Pieter

@skeeto
Copy link
Author

skeeto commented Aug 22, 2013

It turns out it was due a similar configuration. I had EDITOR set to
emacsclient -t which fails like the two cases you listed, but if I
drop the -t it works fine. Using -c also triggers this issue.

praet added a commit to praet/magit that referenced this issue Aug 22, 2013
… new frame

When `magit-git-editor' is set to t, *only* use the value of $GIT_EDITOR
or $EDITOR when we're sure that it will launch emacsclient(1) *without*
trying to open a new frame.

Fixes magit#786.

Signed-off-by: Pieter Praet <pieter@praet.org>
@praet
Copy link
Contributor

praet commented Aug 22, 2013

On Wed, 21 Aug 2013 19:11:29 -0700, Christopher Wellons notifications@github.com wrote:

It turns out it was due a similar configuration. I had EDITOR set to
emacsclient -t which fails like the two cases you listed, but if I
drop the -t it works fine. Using -c also triggers this issue.

Hmm, so it blows up when emacsclient(1) tries to open a new frame.

When running magit-with-git-editor-setup' withmagit-git-editor' set to t,
we should not only ensure that ${,GIT_}EDITOR contains "emacsclient", but also
that it doesn't contain one of '("-nw" "-t" "--tty" "-c" "--create-frame").

Would you be so kind as to give the patches in #792 a spin?

Thanks!

Peace

Pieter

@skeeto
Copy link
Author

skeeto commented Aug 23, 2013

@praet Thanks, your git-editor-tty-fix branch fixes it for me. But I see it was rejected for the moment.

@tarsius
Copy link
Member

tarsius commented Aug 23, 2013

I think my fix in #797 is better. Could you please try that too.

@skeeto
Copy link
Author

skeeto commented Aug 23, 2013

@tarsius
Yup, 09bbd97 works with everything I try on my end.

@skeeto skeeto closed this as completed Aug 23, 2013
@praet
Copy link
Contributor

praet commented Aug 26, 2013

On Thu, 22 Aug 2013 18:44:59 -0700, Christopher Wellons notifications@github.com wrote:

@praet Thanks, your git-editor-tty-fix branch fixes it for me. But I
see it was rejected for the moment.

Yeah, #797 is a much better overall solution for the emacsclient(1)-related stuff.

Peace

Pieter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants