Page MenuHomePhabricator

Arcanist glitch for `arc help ---full`
Closed, InvalidPublic

Description

How to reproduce

  • arc help --full
  • goto flag section

You get this (nothing selected) but the enclosing # switch backgroud and forground on my term, not try other terminals, but seems unexpected.

arc-glitch.png (622×849 px, 61 KB)

Possible fix

  • Replace # by X here
  • If you guys agree the fix, i will make a diff (so I can contribuate)

Revisions and Commits

rARC Arcanist
Abandoned

Event Timeline

tycho.tatitscheff raised the priority of this task from to Needs Triage.
tycho.tatitscheff updated the task description. (Show Details)
tycho.tatitscheff renamed this task from Arcanist to Arcanist glitch in hell ---full.Jul 22 2015, 3:05 PM
tycho.tatitscheff renamed this task from Arcanist glitch in hell ---full to Arcanist glitch for `arc help ---full`.Jul 22 2015, 3:10 PM
tycho.tatitscheff added a project: Arcanist.

Your terminal converts visible text into control statements? Which terminal is that? Is it supposed to do that?

Mac Terminal does at least.

Well, I can't really say I'm surprised that Apple would to do something like this.

If you type this:

$ echo '##asdf##'

...what does it print?

I can't reproduce this in Terminal.app.

The echo thing doesn't repro, but I do see the error when running arc help --full

pasted_file (478×682 px, 114 KB)

Does this fix it?

diff --git a/src/workflow/ArcanistFlagWorkflow.php b/src/workflow/ArcanistFlagWorkflow.php
index d842072..b00fd28 100644
--- a/src/workflow/ArcanistFlagWorkflow.php
+++ b/src/workflow/ArcanistFlagWorkflow.php
@@ -40,7 +40,7 @@ EOTEXT
   public function getCommandHelp() {
     return phutil_console_format(<<<EOTEXT
           In the first form, list objects you've flagged. You can provide the
-          names of one or more objects (Maniphest tasks T#\##, Differential
+          names of one or more objects (Maniphest tasks T#\\##, Differential
           revisions D###, Diffusion references rXXX???, or PHIDs PHID-XXX-???)
           to print only flags for those objects.

Hey, it does that for me too (putty) -
arc help flag looks right, but arc help --full and scroll up does do the background flip thing (arc help --full --ansi | less -r too).

I take back what I said about Apple before.

In phutil_console_format(), we convert ##xyz## to inverted text, but the \ present in the input is intended to prevent this.

It does prevent it on my machine, so presumably this is some weird ambiguity with preg_match() rules between PHP or PCRE versions. Since I can't reproduce this, I'm not sure how to fix it.

If the \\ fix above doesn't resolve it, the fix is probably fiddling with the regexps in PhutilConsoleFormatter::formatString(), but I'm not sure how they're misfiring since they work correctly on my machine and I don't see anything ambiguous in the construction.

Sry for the long waitingtime !
As @chad say the echo test did all right.

I just did a quick diff to fix (avoid) the glitch.

I don't know how to reproduce this.