Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: problem with GNU Emacs shell mode



-----BEGIN PGP SIGNED MESSAGE-----

>>>>> "Bart" == Bart Schaefer <schaefer@xxxxxxxxxxxxxxxxxxxxxxx> writes:
>>>>> "Me" = James B. Crigler <crigler@xxxxxxx> writes:

 Bart> Placing a
 Bart>     (setenv "TERM" "emacs")
 Bart> in your ~/.emacs file seems to fix this.

 Me> Neither of these works for me.  I start a shell and get ^M's and
 Me> "echo $TERM" still returns "dumb".  Next idea?

 Bart> If you C-h v process-environment RET in emacs, what is TERM set
 Bart> to?  Maybe you're stomping on the (setenv ...) with a (setq
 Bart> process-environment ...)  or some such, elsewhere?

Nothing, i.e., there is no TERM in process-environment.  (I start
emacs from my .xinitrc so it will be available immediately---well, as
fast as emacs comes up, anyway.)

 Bart> Try this:

 Bart> ;; Don't set TERM=dumb, it bugs zsh.
 Bart> 
 Bart> (require 'comint)
 Bart> (defun comint-exec-1 (name buffer command switches)
 Bart>   (let ((process-environment
 Bart> 	 (nconc
 Bart> 	  (if (and (boundp 'system-uses-terminfo) system-uses-terminfo)
 Bart> 	      (list "EMACS=t" "TERM=emacs"
 Bart> 		    (format "COLUMNS=%d" (frame-width)))
 Bart> 	    (list "EMACS=t" "TERM=emacs"
 Bart> 		  (format "TERMCAP=emacs:co#%d:tc=unknown" (frame-width))))
 Bart> 	  process-environment)))
 Bart>     (apply 'start-process name buffer command switches)))

This also works.  (The previous solution was to add this:

   [[ $TERM = dumb ]] && unsetopt zle

to .zshrc.  Since you (Bart) are a lot more fluent in zsh stuff than I
am, could you comment on the relative merits of the two approaches?

- -- 
Jim Crigler <crigler@xxxxxxx>
Schwartz Electro-Optics, Inc.   Voice:  (407)298-1802 x200
3404 N. Orange Blossom Tr.        Fax:  (407)290-9666
Orlando FL 32804-3498 USA

-----BEGIN PGP SIGNATURE-----
Version: 2.6.2
Comment: Processed by Mailcrypt 3.4, an Emacs/PGP interface

iQCVAwUBMxXdn7UOmtduhAKtAQHdQwQAnvv2N6HDYA4g84INhmzA2O9U4pDHJFN4
jqimfiQv8GrQ/GrSQCQwv68UNSqCaVAds9Rcv0Vx+ax7X2YL4ziCbNeg0T9xmTrE
7tVhW7MAaZ2MDuR9VaLdibUovlSzxTgqc/o/mp+RI6RPcNA2lO1m+zdBZHRdeu7o
/taaOd6zSy8=
=W9YN
-----END PGP SIGNATURE-----



Messages sorted by: Reverse Date, Date, Thread, Author