Coder Social home page Coder Social logo

Colors support for CLI output about jdeploy HOT 6 OPEN

shannah avatar shannah commented on May 26, 2024
Colors support for CLI output

from jdeploy.

Comments (6)

mddanishansari avatar mddanishansari commented on May 26, 2024 1

I had similar issue, you case might be different but this worked for me. I had Jansi in my JAR file, removing jansi.jar from my executable JAR helped fix it for me.

Also try to update jdeploy's dependency shelljs version to 0.8.4

from jdeploy.

andrii-bodnar avatar andrii-bodnar commented on May 26, 2024

@shannah just a friendly reminder ๐Ÿ™‚

from jdeploy.

ravn avatar ravn commented on May 26, 2024

@andrii-bodnar It is your application that behaves differently, which is most likely due to the ANSI library you use not detecting correctly it is being launched from JDeploy.

What ANSI library do you use and how can you configure it to think it is ok in this situation? Environment variables are typically used for this.

from jdeploy.

andrii-bodnar avatar andrii-bodnar commented on May 26, 2024

@ravn I am using the Picocli tool for building CLI and it's using some ANSI library under the hood (PicocliRunner.java#L61), but I'm not sure what the library is used here.

from jdeploy.

ravn avatar ravn commented on May 26, 2024

@andrii-bodnar I had a quick look at the documentation and it looks like the "Enable ANSI or not?" mechanism is described at https://picocli.info/#_heuristics_for_enabling_ansi.

My guess would be that the two environments behave differently regarding either

  1. ANSI is enabled when system property os.name starts with "Windows" and JAnsi Console is installed.

or

  1. ANSI is disabled when Picocli guesses the programโ€™s output stream is not connected to a terminal: when System.console() returns null. This check is omitted if picocli guesses the program is running in a Windows Cygwin, MSYS or MSYS2 environment: when system property os.name starts with "Windows" and either environment variable TERM contains cygwin or starts with xterm or environment variable OSTYPE is defined.

This will require you to experiment to find out exactly what is different, possibly in a debugger. Please update this issue with your findings.

from jdeploy.

andrii-bodnar avatar andrii-bodnar commented on May 26, 2024

@ravn thanks a lot for the detailed investigation!

from jdeploy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.