Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(313)

Issue 2121653002: Fix prompt exporting escaped characters, opt into PS1 mod. (Closed)

Created:
4 years, 5 months ago by dnj
Modified:
4 years, 5 months ago
CC:
chromium-reviews, infra-reviews+infra_chromium.org
Base URL:
https://chromium.googlesource.com/infra/infra.git@master
Target Ref:
refs/heads/master
Project:
infra
Visibility:
Public.

Description

Fix prompt exporting escaped characters, opt into PS1 mod. Shells (bash, zsh at least) fail to interpret escaped characters, notably newline, when evaluating a script via "eval". This means that PS1 prompt augmentation will break promps containing newlines. This can be solved by exporting the escaped literals of those escape characters and using the export FOO=$'...' notation, causing the prompt to acknowledge and interpret those characters when it evaluates them. This patch does this for commonly-encountered escaped characters. BUG=chromium:626210 TEST=local - Ran without fix, mangles prompt. Ran with fix, doesn't. Committed: https://chromium.googlesource.com/infra/infra/+/665cd3ab5c23babeaec3594a98a72c0e37b86fad

Patch Set 1 #

Patch Set 2 : Actually fix the problem, since people apparently care about this. #

Patch Set 3 : Only use $'...' notation if there was actually an escaped character. #

Total comments: 4

Patch Set 4 : Re-enable by default, document the tag, comments. #

Total comments: 4

Patch Set 5 : Splellnig #

Patch Set 6 : Fix pylint error. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+36 lines, -6 lines) Patch
M go/README.md View 1 2 3 4 1 chunk +5 lines, -0 lines 0 comments Download
M go/bootstrap.py View 1 2 3 1 chunk +7 lines, -5 lines 0 comments Download
M go/env.py View 1 2 3 4 5 1 chunk +24 lines, -1 line 0 comments Download

Messages

Total messages: 29 (13 generated)
dnj (Google)
PTAL. This has been annoying me for about a week, I think.
4 years, 5 months ago (2016-07-04 01:20:07 UTC) #2
nodir
It was not fixed by https://codereview.chromium.org/2089403002/ ? On Sun, Jul 3, 2016 at 6:20 PM ...
4 years, 5 months ago (2016-07-04 02:19:32 UTC) #3
dnj (Google)
On 2016/07/04 02:19:32, nodir wrote: > It was not fixed by https://codereview.chromium.org/2089403002/ ? Nope. I ...
4 years, 5 months ago (2016-07-04 06:09:54 UTC) #5
nodir
deferring to vadimsh@ and tansell@
4 years, 5 months ago (2016-07-06 23:07:31 UTC) #7
dnj (Google)
It'd be super cool to land this so I can actually use my prompt again ...
4 years, 5 months ago (2016-07-07 01:02:57 UTC) #8
mithro
LGTM with a couple of minor nits. (I don't think my LGTM will be enough ...
4 years, 5 months ago (2016-07-07 02:09:39 UTC) #9
dnj (Google)
> If this works as described, I'm okay with making this compromise. With this > ...
4 years, 5 months ago (2016-07-07 03:43:06 UTC) #12
dnj (Google)
https://codereview.chromium.org/2121653002/diff/40001/go/env.py File go/env.py (right): https://codereview.chromium.org/2121653002/diff/40001/go/env.py#newcode35 go/env.py:35: # Replace special characters with their escaped form. This ...
4 years, 5 months ago (2016-07-07 03:43:30 UTC) #14
mithro
Definitely LGTM (with spelling fixes). (However, I haven't actually tested this myself :). https://codereview.chromium.org/2121653002/diff/60001/go/README.md File ...
4 years, 5 months ago (2016-07-07 04:48:14 UTC) #16
dnj (Google)
Thanks for the preview! Ping nodir@ or vadimsh@, this is not a hugely risky CL, ...
4 years, 5 months ago (2016-07-07 06:58:06 UTC) #17
dnj (Google)
On 2016/07/07 06:58:06, dnj (Google) wrote: > Thanks for the preview! Ping nodir@ or vadimsh@, ...
4 years, 5 months ago (2016-07-07 07:01:14 UTC) #18
nodir
lgtm
4 years, 5 months ago (2016-07-07 16:55:18 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2121653002/80001
4 years, 5 months ago (2016-07-07 17:05:01 UTC) #22
commit-bot: I haz the power
Try jobs failed on following builders: Infra Presubmit on master.tryserver.infra (JOB_FAILED, https://build.chromium.org/p/tryserver.infra/builders/Infra%20Presubmit/builds/2966)
4 years, 5 months ago (2016-07-07 17:10:15 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2121653002/100001
4 years, 5 months ago (2016-07-07 17:26:34 UTC) #27
commit-bot: I haz the power
4 years, 5 months ago (2016-07-07 17:42:30 UTC) #29
Message was sent while issue was closed.
Committed patchset #6 (id:100001) as
https://chromium.googlesource.com/infra/infra/+/665cd3ab5c23babeaec3594a98a72...

Powered by Google App Engine
This is Rietveld 408576698