-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sed command wasn't properly removing color escapes #3
sed command wasn't properly removing color escapes #3
Conversation
Previously, sack wasn't correctly sanitizing the colored results from ack or ag. This patch changes the sed command used to sanitize the colored results from using the hex representation of an escape, \x1B, to using an escape literal, �. This corrects the problem.
It’s strange but both commands don’t work for me on a Mac: in Terminal.app and iTerm. But |
👍 also having this problem. seems the author has vanished? 2 months no response :( |
👍 |
Sorry about this. I've been busy with school then new job. I'll do the pull
|
The Mac OS X version does not work, a working version is: |
Way late to the party but if you are on OSX with brew installed, you can fix this by doing the following: $ brew install gnu-sed
$ mkdir -p ~/bin
$ cd ~/bin
$ ln -s $(which gsed) sed This way you don't need to make any changes to sack. |
I've long since ditched sack to use the-silver-searcher |
If you like the-silver-searcher and the idea of sack, you could try zoom which was inspired by sack. |
sed command wasn't properly removing color escapes
mjwhitta@ sack (Shortcut-Ack) also includes "sag" (Shortcut-Ag), which wraps ag (the-silver-searcher). I looked at https://gitlab.com/mjwhitta/zoom -- awesome work!! |
When I was using sack, I did like sag. Unfortunately I found it didn't work with all the flags that sack supported. I created a pull request to fix it, but I wasn't sure it would get merged. I also have a bad (?) habit of rewriting tools from scratch myself so I can learn more about how they work, hence zoom. |
Previously, sack wasn't correctly sanitizing the colored results from
ack or ag. This patch changes the sed command used to sanitize the
colored results from using the hex representation of an escape, \x1B, to
using an escape literal, �. This corrects the problem.