git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Matt Coleman <cat.moleman@gmail.com>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: "Stephon Harris" <theonestep4@gmail.com>,
	git@vger.kernel.org, "Duy Nguyen" <pclouds@gmail.com>,
	"SZEDER Gábor" <szeder.dev@gmail.com>
Subject: Re: [PATCH] specify encoding for sed command
Date: Tue, 10 Apr 2018 03:18:13 -0400	[thread overview]
Message-ID: <DB5A1CE2-7844-4CB6-A03E-6AAC4EC13D66@gmail.com> (raw)
In-Reply-To: <87605616vr.fsf@evledraar.gmail.com>

> 1) What platform OS / version / sed version is this on?
I'm experiencing this on macOS Sierra (10.12.6). The issue occurs with the OS's native sed, which is FreeBSD sed so the version number is kind of ambiguous.

The error goes away if I set LANG=C or LC_ALL=C or change it to use GNU sed (installed via homebrew as gsed).

> 2) What's the output from "set" that's causing this error? Do we have an
>   isolated test case for that?
On my system, it's caused by whatever powerline is doing to Bash's PS1 variable:
$ set | grep ^PS1= | sed 's/foo/bar/'
sed: RE error: illegal byte sequence

I'm not sure exactly which character is bad here:
$ xxd <<<$PS1
00000000: 5c5b 1b5b 303b 3338 3b32 3b32 3535 3b32  \[.[0;38;2;255;2
00000010: 3535 3b32 3535 3b34 383b 323b 303b 3133  55;255;48;2;0;13
00000020: 353b 3137 353b 316d 5c5d c2a0 6d61 7474  5;175;1m\]..matt
00000030: c2a0 5c5b 1b5b 303b 3338 3b32 3b30 3b31  ..\[.[0;38;2;0;1
00000040: 3335 3b31 3735 3b34 383b 323b 3838 3b38  35;175;48;2;88;8
00000050: 383b 3838 3b32 326d 5c5d ee82 b0c2 a05c  8;88;22m\].....\
00000060: 5b1b 5b30 3b33 383b 323b 3230 383b 3230  [.[0;38;2;208;20
00000070: 383b 3230 383b 3438 3b32 3b38 383b 3838  8;208;48;2;88;88
00000080: 3b38 383b 316d 5c5d 7ec2 a05c 5b1b 5b30  ;88;1m\]~..\[.[0
00000090: 3b33 383b 323b 3133 383b 3133 383b 3133  ;38;2;138;138;13
000000a0: 383b 3438 3b32 3b38 383b 3838 3b38 383b  8;48;2;88;88;88;
000000b0: 3232 6d5c 5dee 82b1 c2a0 5c5b 1b5b 303b  22m\].....\[.[0;
000000c0: 3338 3b32 3b32 3038 3b32 3038 3b32 3038  38;2;208;208;208
000000d0: 3b34 383b 323b 3838 3b38 383b 3838 3b31  ;48;2;88;88;88;1
000000e0: 6d5c 5dc2 a0c2 a0c2 a0c2 a0c2 a0c2 a0c2  m\].............
000000f0: a0c2 a0c2 a0c2 a0c2 a0c2 a0c2 a0c2 a0c2  ................
00000100: a0c2 a0c2 a0c2 a0c2 a0c2 a0c2 a0c2 a0c2  ................
00000110: a0c2 a0c2 a0c2 a0c2 a0c2 a0c2 a0c2 a0c2  ................
00000120: a0c2 a0c2 a0c2 a0c2 a0c2 a0c2 a0c2 a0c2  ................
00000130: a0c2 a0c2 a0c2 a0c2 a0c2 a0c2 a0c2 a05c  ...............\
00000140: 5b1b 5b30 3b33 383b 323b 3438 3b34 383b  [.[0;38;2;48;48;
00000150: 3438 3b34 383b 323b 3838 3b38 383b 3838  48;48;2;88;88;88
00000160: 3b32 326d 5c5d c2a0 ee82 b25c 5b1b 5b30  ;22m\].....\[.[0
00000170: 3b33 383b 323b 3135 383b 3135 383b 3135  ;38;2;158;158;15
00000180: 383b 3438 3b32 3b34 383b 3438 3b34 386d  8;48;2;48;48;48m
00000190: 5c5d c2a0 3230 3138 2d30 342d 3130 5c5b  \]..2018-04-10\[
000001a0: 1b5b 303b 3338 3b32 3b39 383b 3938 3b39  .[0;38;2;98;98;9
000001b0: 383b 3438 3b32 3b34 383b 3438 3b34 383b  8;48;2;48;48;48;
000001c0: 3232 6d5c 5dc2 a0ee 82b3 5c5b 1b5b 303b  22m\].....\[.[0;
000001d0: 3338 3b32 3b32 3038 3b32 3038 3b32 3038  38;2;208;208;208
000001e0: 3b34 383b 323b 3438 3b34 383b 3438 3b31  ;48;2;48;48;48;1
000001f0: 6d5c 5dc2 a030 333a 3136 c2a0 5c5b 1b5b  m\]..03:16..\[.[
00000200: 306d 5c5d 205c 5b1b 5b30 3b33 383b 323b  0m\] \[.[0;38;2;
00000210: 3135 383b 3135 383b 3135 383b 3438 3b32  158;158;158;48;2
00000220: 3b34 383b 3438 3b34 386d 5c5d c2a0 c2a0  ;48;48;48m\]....
00000230: 5c5b 1b5b 303b 3338 3b32 3b34 383b 3438  \[.[0;38;2;48;48
00000240: 3b34 383b 3439 3b32 326d 5c5d ee82 b0c2  ;48;49;22m\]....
00000250: a05c 5b1b 5b30 6d5c 5d0a                 .\[.[0m\].

  parent reply	other threads:[~2018-04-10  7:18 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-05  3:10 [PATCH] specify encoding for sed command Stephon Harris
2018-04-05  6:53 ` Ævar Arnfjörð Bjarmason
2018-04-05  9:42   ` Eric Sunshine
2018-04-05  9:43   ` SZEDER Gábor
2018-04-10  7:18   ` Matt Coleman [this message]
2018-04-11 20:42     ` Matt Coleman
2018-04-12 22:12       ` Matthew Coleman
2018-04-13  0:01         ` SZEDER Gábor
2018-04-13  3:00           ` Matthew Coleman
2018-04-13 10:30             ` [PATCH] completion: reduce overhead of clearing cached --options SZEDER Gábor
2018-04-13 21:44               ` Jakub Narebski
2018-04-13 22:23                 ` SZEDER Gábor
2018-04-14 13:27                   ` Jakub Narebski
2018-04-16 18:23                     ` Jacob Keller
2018-04-16 20:35                       ` Matthew Coleman
2018-04-16  5:10                   ` Junio C Hamano
2018-04-16 13:15                     ` SZEDER Gábor
2018-04-16 13:29                       ` Jakub Narębski
2018-04-16 22:43                         ` Junio C Hamano
2018-04-17 22:02                           ` [PATCH v2] " SZEDER Gábor
2018-04-17 23:45                             ` Junio C Hamano
2018-05-07 15:05                               ` Matthew Coleman
2018-05-08  2:28                                 ` Todd Zullinger
2018-05-08  3:28                                   ` Junio C Hamano
2018-06-07  5:48                             ` Jonathan Nieder
2018-06-07 12:07                               ` Dave Borowitz
2018-06-07 12:41                               ` Rick van Hattem
2018-06-08 21:16                               ` SZEDER Gábor
2018-06-08 21:23                                 ` Jonathan Nieder
2018-06-08 21:41                                   ` SZEDER Gábor
2018-06-08 21:52                                     ` Jonathan Nieder
2018-06-08 21:58                                       ` SZEDER Gábor
2018-06-11 17:53                                   ` Junio C Hamano
2018-06-11 18:20                                 ` [PATCH] completion: correct zsh detection when run from git-completion.zsh (Re: [PATCH v2] completion: reduce overhead of clearing cached --options) Jonathan Nieder
2018-06-12  8:46                                   ` SZEDER Gábor
2018-06-12  9:48                                   ` SZEDER Gábor
2018-06-12  9:51                                   ` Rick van Hattem
2018-04-08 23:17 ` [PATCH] specify encoding for sed command Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DB5A1CE2-7844-4CB6-A03E-6AAC4EC13D66@gmail.com \
    --to=cat.moleman@gmail.com \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=pclouds@gmail.com \
    --cc=szeder.dev@gmail.com \
    --cc=theonestep4@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).