emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/detached cfe69e4978 09/22: Add detached-terminal-data-c


From: ELPA Syncer
Subject: [elpa] externals/detached cfe69e4978 09/22: Add detached-terminal-data-command
Date: Mon, 30 May 2022 10:57:30 -0400 (EDT)

branch: externals/detached
commit cfe69e4978e19ca7aa2f72d5009906805eeafdfa
Author: Niklas Eklund <niklas.eklund@posteo.net>
Commit: Niklas Eklund <niklas.eklund@posteo.net>

    Add detached-terminal-data-command
    
    Depending on operating system and version of the tool script, the
    command needs to be altered.
    
    Provide a way for users to customize the command.
---
 detached.el           | 9 +++++----
 test/detached-test.el | 1 +
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/detached.el b/detached.el
index d6741a72c9..e9e8ebbdd9 100644
--- a/detached.el
+++ b/detached.el
@@ -87,8 +87,8 @@
   :type 'string
   :group 'detached)
 
-(defcustom detached-env nil
-  "The name of, or path to, the `detached' environment script."
+(defcustom detached-terminal-data-command "script --quiet --flush --return 
--command \"%s\" /dev/null"
+  "The command for the tool script, which is used to record terminal data."
   :type 'string
   :group 'detached)
 
@@ -1165,8 +1165,9 @@ If SESSION is non-attachable fallback to a command that 
doesn't rely on tee."
           (shell-quote-argument
            (format "if %s; then true; else echo \"[detached-exit-code: $?]\"; 
fi"
                    (if (eq 'terminal-data (detached--session-env-mode session))
-                       (format "TERM=eterm-color script --quiet --flush 
--return --command \"%s\" /dev/null"
-                               (detached--session-command session))
+                       (format "TERM=eterm-color %s"
+                               (format detached-terminal-data-command
+                                       (detached--session-command session)))
                      (detached--session-command session))))))
     (format "%s %s %s; %s %s" begin-shell-group env command end-shell-group 
redirect)))
 
diff --git a/test/detached-test.el b/test/detached-test.el
index 9e3dbb1a54..4daa90eedb 100644
--- a/test/detached-test.el
+++ b/test/detached-test.el
@@ -206,6 +206,7 @@
 
 (ert-deftest detached-test-detached-command ()
   (let ((detached-shell-program "bash")
+        (detached-terminal-data-command "script --quiet --flush --return 
--command \"%s\" /dev/null")
         (attachable-terminal-data-session
          (detached--session-create :directory "/tmp/detached/"
                                    :working-directory "/home/user/"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]