From 2c241ec8082ac5e826e2aaf29ff6d2eb94198c17 Mon Sep 17 00:00:00 2001 From: Doan Tran Cong Danh Date: Thu, 14 Nov 2019 23:05:16 +0700 Subject: [PATCH] zsh: commit-to-history: keep escaped character Prior to this change, when committing this line to history echo "hello\"world" zsh will record this line in history instead: echo "hello"world" because the \" is processed by print. Correct it by print in raw mode. Signed-off-by: Doan Tran Cong Danh --- etc/zsh/zshrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index afb0a56..0a7d730 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -895,7 +895,7 @@ zle -N end-of-somewhere beginning-or-end-of-somewhere # add a command line to the shells history without executing it function commit-to-history () { - print -s ${(z)BUFFER} + print -rs ${(z)BUFFER} zle send-break } zle -N commit-to-history -- 2.1.4