Re: [PATCH] specify encoding for sed command
- From
Matthew Coleman <matt@1eanda.com>
- Date
- Apr 13, 2018, 03:00 UTC
- Message-ID
- <ACE8F169-7700-4D60-85CB-786C6BEBF0B7@1eanda.com>
- In-Reply-To
- <20180413000105.21708-1-szeder.dev@gmail.com>
Show 8 quoted lines
>> I think the best way to move forward with this is a new patch that uses >> `awk` instead of `sed`: I tested several `awk` variants and the command >> was portable without requiring any changes to LANG or LC_ALL. >> >> Does that sound like a good plan? > > No ;) > Could you please give the patch below a try?
Your patch works great and is clearly a way better approach than parsing the output of `set`.
> I'm just not sure whether we should burden this otherwise nice and short > commit message with the details of this Powerline-macOS-Bash-sed issue...
It might be worth mentioning it briefly, in order to reduce the chances of a regression in the future. Maybe something like... "In Bash we can do better: run the 'compgen -v __gitcomp_builtin_' builtin command, which lists the same variables, but without the risk of errors caused by poor Unicode handling in some shells' 'set' builtin command or the overhead of executing 'sed'."