tags:

views:

56

answers:

3

I'm using emacs.app 23.1.1 on OsX and trying to use git within a shell.
When I use a command like git log-p, I get

WARNING: terminal is not fully functional
-  (press RETURN)

I also get something similar with git commit and I'm forced to use git commit -m.

How can I configure emacs.app so this works within its shell?

+1  A: 

Does this work for you?

M-x term

See the docs (it provides a more complete terminal emulation than just M-x shell).

Trey Jackson
I get further with git commit. It seems to open up vi. When I wq vi, I get
hiheelhottie
".git/COMMIT_EDITMSG" 10L, 281C writtenerror: There was a problem with the editor 'vi'.Please supply the message using either -m or -F option.
hiheelhottie
Is there a way to make the editor emacs and any other tips on how to get this to work? Thanks.
hiheelhottie
@hiheelhottie Is the shell you're using a shell inside Emacs? (that's what I first thought) Or is it a different terminal?
Trey Jackson
+2  A: 

Did you at least configure your git editor to be emacs? (as illustrated both in the Pro Git book and in Community Git book)

git config –global core.editor emacs

Because then, 'vi' should never be called.

VonC
Looks like i need to delve into the book. Getting: emacs: Terminal type "dumb" is not powerful enough to run Emacs.It lacks the ability to position the cursor.If that is not the actual type of terminal you have,use the Bourne shell command `TERM=... export TERM' (C-shell:`setenv TERM ...') to specify the correct type. It may be necessaryto do `unset TERMINFO' (C-shell: `unsetenv TERMINFO') as well.error: There was a problem with the editor 'emacs'.Please supply the message using either -m or -F option.
hiheelhottie
@hiheelhottie: did you take a look at http://stackoverflow.com/questions/116560 ?
VonC
git config --global core.editor emacsclient did the trick with (server-start) in my init emacs file. Save and then C-x C-# to close the buffer window to get back to git cmd line.
hiheelhottie
A: 

*shell* is a dumb terminal, so you're not going to get very far. I second Trey Jackson's recommendation of M-x term. At that point, you're still likely to have problems: the term info for the eterm-color is not typically installed. As a temporary fix you can try

mkdir ~/.terminfo/65;
cp /Applications/MacPorts/Emacs.app/Contents/Resources/etc/e/eterm-color ~/.terminfo/65/

to get the copy that emacs.app brought along (assuming you have emacs.app installed through MacPorts - adjust the path as needed). If all goes well, then you can consider setting things up in the global term info 'database'.

Also: If you're running the shell in emacs and you set the editor to emacs, you'll end up trying to load emacs inside the shell inside emacs. That's bound to be a headache. Take a look at emacs server and/or daemon mode.

0x4b