]> git.eshelyaron.com Git - emacs.git/commit
Ensure that Eshell users can run lines of command output as input
authorJim Porter <jporterbugs@gmail.com>
Mon, 6 Feb 2023 05:37:08 +0000 (21:37 -0800)
committerJim Porter <jporterbugs@gmail.com>
Fri, 10 Feb 2023 06:32:51 +0000 (22:32 -0800)
commitab7c2f809219b0c29e7ee2b5ac66f18b0e657080
treea2218c0fb8eca8bd391ea54be7f068ad0d56560b
parentc53255f67758cbd528c3422e248c0cb979a9a676
Ensure that Eshell users can run lines of command output as input

Previously, this failed to work properly because any additional input
the user entered would have no 'field' property, confusing
'eshell-get-old-input'.  To fix this, we simply ensure that any
user-entered text in the output field retains said output field
(bug#61310).

* lisp/eshell/esh-util.el (eshell-command-output-properties): New
variable.
(eshell--mark-as-output, eshell--mark-yanked-as-output): New
functions, mostly copied from comint.

* lisp/eshell/esh-proc.el (eshell-interactive-process-filter):
* lisp/eshell/esh-mode.el (eshell-interactive-print): Call
'eshell--mark-as-output'.
(eshell-get-old-input): Remove properties from the returned string
just to be safe.

* test/lisp/eshell/eshell-tests.el (eshell-test-value): New variable.
(eshell-test/get-old-input/rerun-command)
(eshell-test/get-old-input/run-output): New tests.

* test/lisp/eshell/em-prompt-tests.el
(em-prompt-test/field-properties)
(em-prompt-test/field-properties/no-highlight): Use
'eshell-command-output-properties'.
lisp/eshell/esh-mode.el
lisp/eshell/esh-proc.el
lisp/eshell/esh-util.el
test/lisp/eshell/em-prompt-tests.el
test/lisp/eshell/eshell-tests.el