[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/detached 3f43ad52bc 1/5: Add defcustom for tee program
From: |
ELPA Syncer |
Subject: |
[elpa] externals/detached 3f43ad52bc 1/5: Add defcustom for tee program |
Date: |
Sat, 8 Oct 2022 14:57:32 -0400 (EDT) |
branch: externals/detached
commit 3f43ad52bc61b91b4e6f9ee07eebff730ce49553
Author: Niklas Eklund <niklas.eklund@posteo.net>
Commit: Niklas Eklund <niklas.eklund@posteo.net>
Add defcustom for tee program
---
detached.el | 7 ++++++-
test/detached-test.el | 1 +
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/detached.el b/detached.el
index 9836454e34..f836468303 100644
--- a/detached.el
+++ b/detached.el
@@ -86,6 +86,11 @@
:type 'string
:group 'detached)
+(defcustom detached-tee-program "tee"
+ "The name of the tee program."
+ :type 'string
+ :group 'detached)
+
(defcustom detached-shell-program shell-file-name
"Path to the shell to run the dtach command in."
:type 'string
@@ -1390,7 +1395,7 @@ If SESSION is degraded fallback to a command that doesn't
rely on tee."
(redirect
(if (detached--session-degraded session)
(format "&> %s" log)
- (format "2>&1 | tee %s" log)))
+ (format "2>&1 | %s %s" detached-tee-program log)))
(shell (format "%s -c" detached-shell-program))
(command
(shell-quote-argument
diff --git a/test/detached-test.el b/test/detached-test.el
index c11644ca60..bf823b4a7b 100644
--- a/test/detached-test.el
+++ b/test/detached-test.el
@@ -212,6 +212,7 @@
(ert-deftest detached-test-detached-command ()
(let ((detached-shell-program "bash")
(detached-terminal-data-command "script --quiet --flush --return
--command \"%s\" /dev/null")
+ (detached-tee-program "tee")
(terminal-data-session
(detached--session-create :directory "/tmp/detached/"
:working-directory "/home/user/"