Function: term-send-string

term-send-string is a byte-compiled function defined in term.el.gz.

Signature

(term-send-string PROC STR)

Documentation

Send to PROC the contents of STR as input.

This is equivalent to process-send-string, except that long input strings are broken up into chunks of size term-input-chunk-size. Processes are given a chance to output between chunks. This can help prevent processes from hanging when you send them long inputs on some OS's.

Source Code

;; Defined in /usr/src/emacs/lisp/term.el.gz
(defun term-send-string (proc str)
  "Send to PROC the contents of STR as input.
This is equivalent to `process-send-string', except that long input strings
are broken up into chunks of size `term-input-chunk-size'.  Processes
are given a chance to output between chunks.  This can help prevent processes
from hanging when you send them long inputs on some OS's."
  (let* ((len (length str))
	 (i (min len term-input-chunk-size)))
    (process-send-string proc (substring str 0 i))
    (while (< i len)
      (let ((next-i (+ i term-input-chunk-size)))
	(accept-process-output)
	(process-send-string proc (substring str i (min len next-i)))
	(setq i next-i)))))