From a68427dd89a3d69d423705a7c83de151bf27a497 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Tue, 9 May 2023 12:35:39 +0100 Subject: [PATCH] dot/zshrc: Fix Emacs integration properly. This was a mess. I'd had a hack to inhibit line-editing in `dumb' terminals for ages, but grew an extra one as an overreaction against TRAMP's allergy to bracketted-paste. Rationalize all of this. * Move the logic to inhibit line-editing into the right configuration section. * Only inhibit line-editing in `dumb' terminals that aren't running in Emacs. * Inhibit bracketted-paste in `dumb' terminals, but not otherwise. The result is that I can still use line editing in `dumb' terminals, but Emacs -- and particularly TRAMP -- work properly. --- dot/zshrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dot/zshrc b/dot/zshrc index 3466d6c..9565fd6 100644 --- a/dot/zshrc +++ b/dot/zshrc @@ -3,7 +3,6 @@ ### Zsh session things. __mdw_shell=zsh -case ${INSIDE_EMACS+t},$TERM in t,dumb) unsetopt zle ;; esac ###-------------------------------------------------------------------------- ### History settings. @@ -63,7 +62,8 @@ fi ###-------------------------------------------------------------------------- ### Line editing. -case $TERM in dumb) unsetopt zle ;; esac +case ${INSIDE_EMACS+t},$TERM in t,dumb) unsetopt zle ;; esac +case $TERM in dumb) unset zle_bracketed_paste ;; esac bindkey -e -- 2.11.0