Uploaded image for project: 'Maven Shared Components'
  1. Maven Shared Components
  2. MSHARED-615

Change characters used to diplay trees to make relationships clearer

    Details

      Description

      NPM for example uses characters such as:

      ├── foo
      │ ├── bar
      │ └── baz

      I feel these characters make it much clearer then there is a large tree on screen what is related to what.

        Issue Links

          Activity

          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user asfgit closed the pull request at:

          https://github.com/apache/maven-shared/pull/19

          Show
          githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/maven-shared/pull/19
          Hide
          hudson Hudson added a comment -

          SUCCESS: Integrated in Jenkins build maven-shared #3720 (See https://builds.apache.org/job/maven-shared/3720/)
          MSHARED-615 Change characters used to diplay trees to make relationships clearer

          Submitted-by: Keir Lawson <keirlawson@gmail.com>

          This closes #19 (michaelo: http://svn.apache.org/viewvc/?view=rev&rev=1791414)

          • (edit) maven-dependency-tree/src/main/java/org/apache/maven/shared/dependency/graph/traversal/SerializingDependencyNodeVisitor.java
          Show
          hudson Hudson added a comment - SUCCESS: Integrated in Jenkins build maven-shared #3720 (See https://builds.apache.org/job/maven-shared/3720/ ) MSHARED-615 Change characters used to diplay trees to make relationships clearer Submitted-by: Keir Lawson <keirlawson@gmail.com> This closes #19 (michaelo: http://svn.apache.org/viewvc/?view=rev&rev=1791414 ) (edit) maven-dependency-tree/src/main/java/org/apache/maven/shared/dependency/graph/traversal/SerializingDependencyNodeVisitor.java
          Hide
          michael-o Michael Osipov added a comment -

          Fixed with r1791414.

          Show
          michael-o Michael Osipov added a comment - Fixed with r1791414 .
          Hide
          githubbot ASF GitHub Bot added a comment -

          GitHub user keirlawson opened a pull request:

          https://github.com/apache/maven-shared/pull/19

          MSHARED-615 Use unicode box characters for extended tokens

          You can merge this pull request into a Git repository by running:

          $ git pull https://github.com/keirlawson/maven-shared trunk

          Alternatively you can review and apply these changes as the patch at:

          https://github.com/apache/maven-shared/pull/19.patch

          To close this pull request, make a commit to your master/trunk branch
          with (at least) the following in the commit message:

          This closes #19


          commit 46c8718eae4f442c9e41f10301402e42b849b40a
          Author: Keir Lawson <keirlawson@gmail.com>
          Date: 2017-02-05T22:40:19Z

          MSHARED-615 Use unicode box characters for extended tokens


          Show
          githubbot ASF GitHub Bot added a comment - GitHub user keirlawson opened a pull request: https://github.com/apache/maven-shared/pull/19 MSHARED-615 Use unicode box characters for extended tokens You can merge this pull request into a Git repository by running: $ git pull https://github.com/keirlawson/maven-shared trunk Alternatively you can review and apply these changes as the patch at: https://github.com/apache/maven-shared/pull/19.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #19 commit 46c8718eae4f442c9e41f10301402e42b849b40a Author: Keir Lawson <keirlawson@gmail.com> Date: 2017-02-05T22:40:19Z MSHARED-615 Use unicode box characters for extended tokens
          Hide
          michael-o Michael Osipov added a comment -

          Issue has been moved to the appropriate place. This issue is two-fold:

          1. Improve the shared component for proper tokens
          2. Update Maven Dependency Plugin and evaluate default value switch

          If the new chars work on both shell and cmd, I'd be happy to switch it.

          Show
          michael-o Michael Osipov added a comment - Issue has been moved to the appropriate place. This issue is two-fold: 1. Improve the shared component for proper tokens 2. Update Maven Dependency Plugin and evaluate default value switch If the new chars work on both shell and cmd, I'd be happy to switch it.
          Hide
          keirlawson Keir added a comment - - edited

          Not sure I have permissions to move issues between projects. Will happily create a PR once there is an issue in the relevant place.

          It seems to me that the vast majority of people will have unicode terminals these days, is there a case for enabling tokens=extended by default and for users for whom this will not work allowing them to manually specify ascii-only? I suspect that most users, like myself, are completely unaware of the tokens option (presumably why it has been broken without someone noticing until now!) and yet could benefit from it. Obviously this would be a breaking change so I guess would require a major version bump.

          Show
          keirlawson Keir added a comment - - edited Not sure I have permissions to move issues between projects. Will happily create a PR once there is an issue in the relevant place. It seems to me that the vast majority of people will have unicode terminals these days, is there a case for enabling tokens=extended by default and for users for whom this will not work allowing them to manually specify ascii-only? I suspect that most users, like myself, are completely unaware of the tokens option (presumably why it has been broken without someone noticing until now!) and yet could benefit from it. Obviously this would be a breaking change so I guess would require a major version bump.
          Hide
          michael-o Michael Osipov added a comment -

          This all looks like native code which is not possible in our case. You requested is already implemented, you have to use -Dtokens=extended, but for some strange reason, wrong tokes are defined in source code. You can improve those tokens to those used widely in tree(1) and other commands. I'd move this issue to MSHARED. Do you want to try to create a PR?

          Show
          michael-o Michael Osipov added a comment - This all looks like native code which is not possible in our case. You requested is already implemented, you have to use -Dtokens=extended , but for some strange reason, wrong tokes are defined in source code . You can improve those tokens to those used widely in tree(1) and other commands. I'd move this issue to MSHARED. Do you want to try to create a PR?
          Hide
          keirlawson Keir added a comment -

          I believe NPM uses this package: https://github.com/iarna/has-unicode

          Which describes its algorithm thus:

          Detecting Unicode

          What we actually detect is UTF-8 support, as that's what Node itself supports. If you have a UTF-16 locale then you won't be detected as unicode capable.
          Windows

          Since at least Windows 7, cmd and powershell have been unicode capable, but unfortunately even then it's not guaranteed. In many localizations it still uses legacy code pages and there's no facility short of running programs or linking C++ that will let us detect this. As such, we report any Windows installation as NOT unicode capable, and recommend that you encourage your users to override this via config.
          Unix Like Operating Systems

          We look at the environment variables LC_ALL, LC_CTYPE, and LANG in that order. For LC_ALL and LANG, it looks for .UTF-8 in the value. For LC_CTYPE it looks to see if the value is UTF-8. This is sufficient for most POSIX systems. While locale data can be put in /etc/locale.conf as well, AFAIK it's always copied into the environment.

          Show
          keirlawson Keir added a comment - I believe NPM uses this package: https://github.com/iarna/has-unicode Which describes its algorithm thus: Detecting Unicode What we actually detect is UTF-8 support, as that's what Node itself supports. If you have a UTF-16 locale then you won't be detected as unicode capable. Windows Since at least Windows 7, cmd and powershell have been unicode capable, but unfortunately even then it's not guaranteed. In many localizations it still uses legacy code pages and there's no facility short of running programs or linking C++ that will let us detect this. As such, we report any Windows installation as NOT unicode capable, and recommend that you encourage your users to override this via config. Unix Like Operating Systems We look at the environment variables LC_ALL, LC_CTYPE, and LANG in that order. For LC_ALL and LANG, it looks for .UTF-8 in the value. For LC_CTYPE it looks to see if the value is UTF-8. This is sufficient for most POSIX systems. While locale data can be put in /etc/locale.conf as well, AFAIK it's always copied into the environment.
          Hide
          michael-o Michael Osipov added a comment -

          I assume that NPM uses the same Unicode characters like tree(1). How do you properly detect that the terminal is Unicode-aware?

          Show
          michael-o Michael Osipov added a comment - I assume that NPM uses the same Unicode characters like tree(1) . How do you properly detect that the terminal is Unicode-aware?

            People

            • Assignee:
              michael-o Michael Osipov
              Reporter:
              keirlawson Keir
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development