summaryrefslogtreecommitdiff
path: root/doc/lispref/processes.texi
diff options
context:
space:
mode:
authorJim Porter <jporterbugs@gmail.com>2022-07-19 21:36:54 -0700
committerJim Porter <jporterbugs@gmail.com>2022-08-05 17:58:54 -0700
commit4e59830bc0ab17cdbd85748b133c97837bed99e3 (patch)
tree1fc29e2e33f71d60915c2f15e52a97dd416773ed /doc/lispref/processes.texi
parentd7b89ea4077d4fe677ba0577245328819ee79cdc (diff)
downloademacs-4e59830bc0ab17cdbd85748b133c97837bed99e3.tar.gz
Add STREAM argument to 'process-tty-name'
* src/process.c (process-tty-name): Add STREAM argument. * lisp/eshell/esh-io.el (eshell-close-target): Only call 'process-send-eof' once if the process's stdin is a pipe. * test/src/process-tests.el (make-process/test-connection-type): Check behavior of 'process-tty-name'. * doc/lispref/processes.texi (Process Information): Document the new argument. * etc/NEWS: Announce this change.
Diffstat (limited to 'doc/lispref/processes.texi')
-rw-r--r--doc/lispref/processes.texi21
1 files changed, 15 insertions, 6 deletions
diff --git a/doc/lispref/processes.texi b/doc/lispref/processes.texi
index e253ab9de03..382053ab24a 100644
--- a/doc/lispref/processes.texi
+++ b/doc/lispref/processes.texi
@@ -1243,15 +1243,24 @@ that are already closed, the value is either 0 or 256, depending on
whether the connection was closed normally or abnormally.
@end defun
-@defun process-tty-name process
+@defun process-tty-name process &optional stream
This function returns the terminal name that @var{process} is using for
its communication with Emacs---or @code{nil} if it is using pipes
instead of a pty (see @code{process-connection-type} in
-@ref{Asynchronous Processes}). If @var{process} represents a program
-running on a remote host, the terminal name used by that program on
-the remote host is provided as process property @code{remote-tty}. If
-@var{process} represents a network, serial, or pipe connection, the
-value is @code{nil}.
+@ref{Asynchronous Processes}). By default, this function returns the
+terminal name if any of @var{process}'s standard streams use a
+terminal. If @var{stream} is one of @code{stdin}, @code{stdout}, or
+@code{stderr}, this function returns the terminal name (or @code{nil},
+as above) that @var{process} uses for that stream specifically. You
+can use this to determine whether a particular stream uses a pipe or a
+pty.
+
+If @var{process} represents a program running on a remote host, this
+function returns the @emph{local} terminal name that communicates with
+@var{process}; you can get the terminal name used by that program on
+the remote host with the process property @code{remote-tty}. If
+@var{process} represents a network, serial, or pipe connection, this
+function always returns @code{nil}.
@end defun
@defun process-coding-system process