From 9dffcab6f6953d8203f0d424b65994f952e72f8e Mon Sep 17 00:00:00 2001 From: Guido van Steen Date: Thu, 23 Jun 2011 01:19:21 -0700 Subject: [PATCH] escape `|` in search query before scanning history https://github.com/robbyrussell/oh-my-zsh/pull/215#issuecomment-1422348 --- history-substring-search.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/history-substring-search.zsh b/history-substring-search.zsh index 2e94c77..6a85475 100644 --- a/history-substring-search.zsh +++ b/history-substring-search.zsh @@ -173,7 +173,7 @@ _history-substring-search-begin() { # $BUFFER contains the text that is in the command-line currently. # we put an extra "\\" before meta characters such as "\(" and "\)", # so that they become "\\\(" and "\\\)" - _history_substring_search_query_escaped=${BUFFER//(#m)[\][()\\*?#<>~^]/\\$MATCH} + _history_substring_search_query_escaped=${BUFFER//(#m)[\][()|\\*?#<>~^]/\\$MATCH} # for the purpose of highlighting we will also keep a version without # doubly-escaped meta characters