Variable: eshell-virtual-targets

eshell-virtual-targets is a customizable variable defined in esh-io.el.gz.

Value

(("/dev/eshell" eshell-interactive-print nil)
 ("/dev/kill"
  (lambda
    (mode)
    (if
	(eq mode 'overwrite)
	(kill-new ""))
    'eshell-kill-append)
  t)
 ("/dev/clip"
  (lambda
    (mode)
    (if
	(eq mode 'overwrite)
	(let
	    ((select-enable-clipboard t))
	  (kill-new "")))
    'eshell-clipboard-append)
  t))

Documentation

Map virtual devices name to Emacs Lisp functions.

If the user specifies any of the filenames above as a redirection target, the function in the second element will be called.

If the third element is non-nil, the redirection mode is passed as an argument (which is the symbol overwrite, append or insert), and the function is expected to return another function -- which is the output function. Otherwise, the second element itself is the output function.

The output function is then called repeatedly with single strings, which represents successive pieces of the output of the command, until nil is passed, meaning EOF.

NOTE: /dev/null is handled specially as a virtual target, and should not be added to this variable.

Source Code

;; Defined in /usr/src/emacs/lisp/eshell/esh-io.el.gz
(defcustom eshell-virtual-targets
  '(("/dev/eshell" eshell-interactive-print nil)
    ("/dev/kill" (lambda (mode)
		   (if (eq mode 'overwrite)
		       (kill-new ""))
		   'eshell-kill-append) t)
    ("/dev/clip" (lambda (mode)
		   (if (eq mode 'overwrite)
		       (let ((select-enable-clipboard t))
			 (kill-new "")))
		   'eshell-clipboard-append) t))
  "Map virtual devices name to Emacs Lisp functions.
If the user specifies any of the filenames above as a redirection
target, the function in the second element will be called.

If the third element is non-nil, the redirection mode is passed as an
argument (which is the symbol `overwrite', `append' or `insert'), and
the function is expected to return another function -- which is the
output function.  Otherwise, the second element itself is the output
function.

The output function is then called repeatedly with single strings,
which represents successive pieces of the output of the command, until nil
is passed, meaning EOF.

NOTE: /dev/null is handled specially as a virtual target, and should
not be added to this variable."
  :type '(repeat
	  (list (string :tag "Target")
		function
		(choice (const :tag "Func returns output-func" t)
			(const :tag "Func is output-func" nil))))
  :risky t
  :group 'eshell-io)