summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThierry Volpiatto <thierry.volpiatto@gmail.com>2016-10-15 18:09:50 +0200
committerThierry Volpiatto <thierry.volpiatto@gmail.com>2016-10-15 18:27:26 +0200
commit894b69edc3a2a0d72d5edad9f84beb2133d73744 (patch)
tree3d31bdd15ce44d74bba706b1b678d297fe945976
parent6588eaf47442daa252bff96034dd9a3c983df7b7 (diff)
Fix usage of ripgrep with dumb emacs terminal (#1624).
* helm-grep.el (helm-grep-ag-command): Fix docstring. (helm-grep--ag-command): Fix it when prefixed with an env var.
-rw-r--r--helm-grep.el12
1 files changed, 9 insertions, 3 deletions
diff --git a/helm-grep.el b/helm-grep.el
index 1f1ee507..bb73a3b1 100644
--- a/helm-grep.el
+++ b/helm-grep.el
@@ -1276,6 +1276,12 @@ Here the command line to use with ripgrep:
rg --smart-case --no-heading --line-number %s %s %s
+If you want native color output with ripgrep (--color=always)
+you have to use a workaround as ripgrep is not supporting emacs
+dumb terminal, here it is:
+
+ TERM=eterm-color rg --color=always --smart-case --no-heading --line-number %s %s %s
+
You must use an output format that fit with helm grep, that is:
\"filename:line-number:string\"
@@ -1284,13 +1290,13 @@ The option \"--nogroup\" allow this.
The option \"--line-numbers\" is also mandatory except with PT (not supported).
For RG the options \"--no-heading\" and \"--line-number\" are the ones to use.
-You can use safely \"--color\" (default)
-except for RG (\"--color\" option not working actually in emacs)."
+You can use safely \"--color\" (used by default) with AG and PT."
:group 'helm-grep
:type 'string)
(defun helm-grep--ag-command ()
- (car (split-string helm-grep-ag-command)))
+ (car (helm-remove-if-match
+ "\\`[A-Z]*=" (split-string helm-grep-ag-command))))
(defun helm-grep-ag-get-types ()
"Returns a list of AG types if available with AG version.