aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1994-11-22 10:47:06 +0000
committerRichard M. Stallman1994-11-22 10:47:06 +0000
commit38550ee1d8c293ac63c86482986972cd25fea9fd (patch)
tree12380fb7695b3d21ce0ab90953ca96fee1c16bae
parent869e65bba2bce70f76cb673b9415746c339e82ec (diff)
downloademacs-38550ee1d8c293ac63c86482986972cd25fea9fd.tar.gz
emacs-38550ee1d8c293ac63c86482986972cd25fea9fd.zip
entered into RCS
-rw-r--r--lisp/term.el46
1 files changed, 29 insertions, 17 deletions
diff --git a/lisp/term.el b/lisp/term.el
index 1defc63cb39..c672fca95f2 100644
--- a/lisp/term.el
+++ b/lisp/term.el
@@ -80,6 +80,8 @@
80 80
81;;; Code: 81;;; Code:
82 82
83;;; This is passed to the inferior in the EMACS environment variable,
84;;; so it is important to increase it if there are protocol-relevant changes.
83(defconst term-version "0.93") 85(defconst term-version "0.93")
84 86
85(require 'ring) 87(require 'ring)
@@ -804,11 +806,11 @@ buffer. The hook term-exec-hook is run after each exec."
804(defvar term-term-name "eterm") 806(defvar term-term-name "eterm")
805; Format string, usage: (format term-termcap-string emacs-term-name "TERMCAP=" 24 80) 807; Format string, usage: (format term-termcap-string emacs-term-name "TERMCAP=" 24 80)
806(defvar term-termcap-format 808(defvar term-termcap-format
807 "%s%s:li#%d:co#%d:cl=\\E[;H\\E[2J:bs:am:xn:cm=\\E[%%i%%d;%%dH\ 809 "%s%s:li#%d:co#%d:cl=\\E[H\\E[J:cd=\\E[J:bs:am:xn:cm=\\E[%%i%%d;%%dH\
808:nd=\\E[C:up=\\E[A:ce=\\E[K:ho=\\E[H:pt\ 810:nd=\\E[C:up=\\E[A:ce=\\E[K:ho=\\E[H:pt\
809:al=\\E[L:dl=\\E[M:DL=\\E[%%dM:AL=\\E[%%dL:cs=\\E[%%i%%d;%%dr:sf=\\n\ 811:al=\\E[L:dl=\\E[M:DL=\\E[%%dM:AL=\\E[%%dL:cs=\\E[%%i%%d;%%dr:sf=\\n\
810:te=\\E[2J\\E[?47l\\E8:ti=\\E7\\E[?47h\ 812:te=\\E[2J\\E[?47l\\E8:ti=\\E7\\E[?47h\
811:dc=\\E[P:DC=\\E[%%dP:IC=\\E[%%d@:im=\\E[4h:ei=\E4l:mi:\ 813:dc=\\E[P:DC=\\E[%%dP:IC=\\E[%%d@:im=\\E[4h:ei=\\E[4l:mi:\
812:so=\\E[7m:se=\\E[m:us=\\E[4m:ue=\\E[m:md=\\E[1m:mr=\\E[7m:me=\\E[m\ 814:so=\\E[7m:se=\\E[m:us=\\E[4m:ue=\\E[m:md=\\E[1m:mr=\\E[7m:me=\\E[m\
813:UP=\\E[%%dA:DO=\\E[%%dB:LE=\\E[%%dD:RI=\\E[%%dC" 815:UP=\\E[%%dA:DO=\\E[%%dB:LE=\\E[%%dD:RI=\\E[%%dC"
814;;; : -undefine ic 816;;; : -undefine ic
@@ -818,19 +820,30 @@ buffer. The hook term-exec-hook is run after each exec."
818;;; the appropriate environment. 820;;; the appropriate environment.
819 821
820(defun term-exec-1 (name buffer command switches) 822(defun term-exec-1 (name buffer command switches)
821;; The 'if ...; then shift; fi' hack is because Bourne shell 823 ;; We need to do an extra (fork-less) exec to run stty.
822;; loses one arg when called with -c, and newer shells (bash, ksh) don't. 824 ;; (This would not be needed if we had suitable emacs primitives.)
823;; Thus we add an extra dummy argument "..", and then remove it. 825 ;; The 'if ...; then shift; fi' hack is because Bourne shell
824 (apply 'start-process name buffer 826 ;; loses one arg when called with -c, and newer shells (bash, ksh) don't.
825"/bin/sh" "-c" (format "stty -nl echo rows %d columns %d sane 2>/dev/null; if [ $1 = .. ]; then shift; fi;\ 827 ;; Thus we add an extra dummy argument "..", and then remove it.
826 TERM=$1; export TERM; shift;\ 828 (let ((process-environment
827 TERMCAP=$1; export TERMCAP; shift;\ 829 (nconc
828 EMACS=t; export EMACS;\ 830 (list
829 exec \"$@\"" term-height term-width) 831 (format "TERM=%s" term-term-name)
830 ".." 832 (if (and (boundp 'system-uses-terminfo) system-uses-terminfo)
831 term-term-name 833 (format "TERMINFO=%s" data-directory)
832 (format term-termcap-format "" term-term-name term-height term-width) 834 (format term-termcap-format "TERMCAP="
833 command switches)) 835 term-term-name term-height term-width))
836 (format "EMACS=%s (term:%s)" emacs-version term-version)
837 (format "LINES=%d" term-height)
838 (format "COLUMNS=%d" term-width))
839 process-environment)))
840 (apply 'start-process name buffer
841 "/bin/sh" "-c"
842 (format "stty -nl echo rows %d columns %d sane 2>/dev/null;\
843if [ $1 = .. ]; then shift; fi; exec \"$@\""
844 term-height term-width)
845 ".."
846 command switches)))
834 847
835;;; This should be in emacs, but it isn't. 848;;; This should be in emacs, but it isn't.
836(defun term-mem (item list &optional elt=) 849(defun term-mem (item list &optional elt=)
@@ -2292,7 +2305,7 @@ See `term-prompt-regexp'."
2292 (setq term-insert-mode t)) 2305 (setq term-insert-mode t))
2293 ((eq term-terminal-parameter 47) 2306 ((eq term-terminal-parameter 47)
2294 (term-switch-to-alternate-sub-buffer t)))) 2307 (term-switch-to-alternate-sub-buffer t))))
2295 ;; \E[?h - DEC Private Mode Reset 2308 ;; \E[?l - DEC Private Mode Reset
2296 ((eq char ?l) 2309 ((eq char ?l)
2297 (cond ((eq term-terminal-parameter 4) 2310 (cond ((eq term-terminal-parameter 4)
2298 (setq term-insert-mode nil)) 2311 (setq term-insert-mode nil))
@@ -3095,4 +3108,3 @@ Typing SPC flushes the help buffer."
3095(provide 'term) 3108(provide 'term)
3096 3109
3097;;; term.el ends here 3110;;; term.el ends here
3098