I\'ve been trying to use Zsh within my emacs session, without emacs remapping all the Zsh keys. I found ansi-term works pretty well for this but, I\'m still having some problems
I figured it out. It was an emacs config problem. This bit of elisp in my .emacs was causing it:
(custom-set-variables
'(fringe-mode nil nil (fringe))
'(fringes-outside-margins t t))
Thanks for the help.
Hmmm. I don't think I've ever seen any fancy editing work out well within ansi-term, although I haven't tried it in maybe 20 years. I'll just ask, in passing, if you've tried shell-mode (M-x shell) as it's a lot more natural with EMACS anyway.
That said, reading through the term.el file, it kind of looks like ansi-term is doing a lot of manging of its own. you might want to look at the term raw mode code, starting around line 1230, at least in EMACS 22.3.
I was looking for this as well for quite a while now. For me adding following to the
;; ansi-term
(global-set-key "\C-x\C-a" '(lambda ()(interactive)(ansi-term "/bin/zsh")))
(global-set-key "\C-x\ a" '(lambda ()(interactive)(ansi-term "/bin/zsh")))
works. I picked this from http://svn.assembla.com/svn/id774/scripts/dot_files/dot_emacs.d/elisp/global-set-key.el .
I am sure there are other goodies in that script. As an added bonus screen seems to play nicely with emacs for me.
Try MultiTerm.
Its the only Emacs terminal mode that seems to play nice with zsh. It allows you to easily set which commands you want captured by emacs and which you want routed to the terminal. The default settings have been good enough for me so far though.
Also, add the following to your .zshrc to allow emacs to track your current directory as you cd around.
if [ -n "$INSIDE_EMACS" ]; then
chpwd() { print -P "\033AnSiTc %d" }
print -P "\033AnSiTu %n"
print -P "\033AnSiTc %d"
fi