[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/detached 323b1bb38d 2/5: Add defcustom for script progr
From: |
ELPA Syncer |
Subject: |
[elpa] externals/detached 323b1bb38d 2/5: Add defcustom for script program |
Date: |
Sat, 8 Oct 2022 14:57:32 -0400 (EDT) |
branch: externals/detached
commit 323b1bb38d85407623453e01d946cbe909f08fff
Author: Niklas Eklund <niklas.eklund@posteo.net>
Commit: Niklas Eklund <niklas.eklund@posteo.net>
Add defcustom for script program
---
detached.el | 9 +++++++--
test/detached-test.el | 3 ++-
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/detached.el b/detached.el
index f836468303..d52a2a6d6a 100644
--- a/detached.el
+++ b/detached.el
@@ -91,6 +91,11 @@
:type 'string
:group 'detached)
+(defcustom detached-script-program "script"
+ "The name of the script program."
+ :type 'string
+ :group 'detached)
+
(defcustom detached-shell-program shell-file-name
"Path to the shell to run the dtach command in."
:type 'string
@@ -1412,8 +1417,8 @@ If SESSION is degraded fallback to a command that doesn't
rely on tee."
(defun detached--get-terminal-data-command ()
"Return terminal data command."
(pcase detached-terminal-data-command
- ('gnu/linux "script --quiet --flush --return --command \"%s\" /dev/null")
- ('darwin "script -F -q /dev/null %s")
+ ('gnu/linux (concat detached-script-program " --quiet --flush --return
--command \"%s\" /dev/null"))
+ ('darwin (concat detached-script-program " -F -q /dev/null %s"))
((and (pred stringp) command) command)
(_ (error "Unable to determine script command, set
`detached-terminal-data-command' properly"))))
diff --git a/test/detached-test.el b/test/detached-test.el
index bf823b4a7b..6bd7e2dc62 100644
--- a/test/detached-test.el
+++ b/test/detached-test.el
@@ -211,8 +211,9 @@
(ert-deftest detached-test-detached-command ()
(let ((detached-shell-program "bash")
- (detached-terminal-data-command "script --quiet --flush --return
--command \"%s\" /dev/null")
+ (detached-script-program "script")
(detached-tee-program "tee")
+ (detached-terminal-data-command "script --quiet --flush --return
--command \"%s\" /dev/null")
(terminal-data-session
(detached--session-create :directory "/tmp/detached/"
:working-directory "/home/user/"