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

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

[nongnu] elpa/with-editor 9097321 112/140: with-editor-export-editor: Fi


From: Jonas Bernoulli
Subject: [nongnu] elpa/with-editor 9097321 112/140: with-editor-export-editor: Fix for term-mode
Date: Fri, 6 Aug 2021 12:51:31 -0400 (EDT)

branch: elpa/with-editor
commit 90973212cee3655746c95d0e0cae2f8f5bf3d97e
Author: Stéphane Soppera <soppera@users.noreply.github.com>
Commit: Jonas Bernoulli <jonas@bernoul.li>

    with-editor-export-editor: Fix for term-mode
    
    The previous value of `with-editor-sleeping-editor' variable was using
    the \x1f character in the elisp string and sending it to the
    shell/term process.
    
    For `shell-mode' this is not an issue since the character is not
    interpreted by the shell. But in `term-mode' the terminal emulation
    interprets it and remove previous characters, the "$0" string. So we
    end up with an EDITOR environment variable that contains an echo
    command with "…OPEN IN…" instead of "…OPEN $0^_ IN…" (here "^_" is
    used to represent the \x1f byte).
    
    This change fixes the issue by using `-e' flag of `echo' and using the
    `\037' octal escape sequence for the \x1f byte.
---
 with-editor.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/with-editor.el b/with-editor.el
index 7612200..4e439b7 100644
--- a/with-editor.el
+++ b/with-editor.el
@@ -176,7 +176,7 @@ please see 
https://github.com/magit/magit/wiki/Emacsclient.";))))
 
 (defcustom with-editor-sleeping-editor "\
 sh -c '\
-echo \"WITH-EDITOR: $$ OPEN $0 IN $(pwd)\"; \
+echo -e \"WITH-EDITOR: $$ OPEN $0\\037 IN $(pwd)\"; \
 sleep 604800 & sleep=$!; \
 trap \"kill $sleep; exit 0\" USR1; \
 trap \"kill $sleep; exit 1\" USR2; \



reply via email to

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