Git Product home page Git Product logo

Comments (15)

iarna avatar iarna commented on June 11, 2024 1

Ok, to update the "can we use fancy braille on Linux distros" thread:

I've tested on the latest Ubuntu and Fedora. They're quite lovely on the former and super ugly on the latter (due to font selection).

But there's a further wrinkle which will means that this theme can't be the default for Ubuntu:

If I'm sshed into an Ubuntu box, there's no way to know what unicode my terminal will support.

Overriding themes w/ the new gauge is easy (and they're named now, so you can say you want the colorBrailleSpinner theme and get that). Access to theming will be exposed all the way up the chain with it, so expect that to show up in npmlog and npm when we integrate this version.

from gauge.

iarna avatar iarna commented on June 11, 2024

Mentioned elsewhere:

https://github.com/sindresorhus/elegant-spinner
https://github.com/helloIAmPau/node-spinner/blob/master/index.js#L13-L32

from gauge.

Fishrock123 avatar Fishrock123 commented on June 11, 2024

Hmmm, maybe there could also be some sort of percentage display?

Being able to define spinner animations could definitely be cool. I quite like elegant-spinner. Could even be configurable in some npm config?

I'm quite wondering how it might be best to deal with sub-jobs, or concurrency. pnpm has a pretty cool display of concurrency, for example. Perhaps that is out of scope though.

I suppose to some degree, sub-jobs is up to the implementing application to handle correctly?

Edit: fwiw I previously made https://github.com/Fishrock123/cli-status (Not very good, please don't use it lol)

from gauge.

iarna avatar iarna commented on June 11, 2024

Sub-job tracking / concurrency is probably out of scope for this module yeah, since this is just about drawing bars on the screen. npm has a pretty good handle on what's going on via are-we-there-yet trees, but we aren't exposing that currently.

But there's no reason that npm couldn't setup an arbitrarily complicated gauge theme to track that kind of thing. (In gauge@1, you could only pass in section/subsection text, but in gauge@2 you can pass in arbitrary values, and if they're in the theme they'll be displayed.)

TBH, I'm not actually convinced how valuable that is. npm side the main thing I'd like to see is real network-layer support. That is, I'd like it to be using are-we-there-yet stream objects to track download completion instead of just starting a timed spinner.

from gauge.

iarna avatar iarna commented on June 11, 2024

If we end up really wanting to track concurrent jobs we might also look at supporting multi-line statuses.

The advantage of single line status areas is that you can update them without using any ansi codes– just CR and go.

from gauge.

yongtw123 avatar yongtw123 commented on June 11, 2024

2nd edit: Remove unnecessary information

I'd like to report on Win 7 (CJK code page) the new gauge seems to work on default cmd. However when I tested on a terminal emulator (i.e. ConEmu), new gauge lines keep printing one after another. The situation goes away mostly when the current theme is 'nocolor'.
colornocolor
Since I expect at least non-unicode themes to work under Windows environment, I looked into theme.js and noticed themes.fallback.noUnicode.hasColor.remaining (░) seems not a pure ANSI character. After changing it to any other pure ASCII character (not including the extended ones), the issue is gone, at least for non-darwin themes.

Perhaps I'd suggest sticking to pure ASCII for non-Unicode themes to maximize compatibility?

By the way, running demo.js requires a dependency which is not in package.json: signal-exit.

from gauge.

gillesdemey avatar gillesdemey commented on June 11, 2024

I'm a big fan of the elegant spinner for terminals that support unicode (using braille characters), I don't have a strong preference for the ascii spinner.

Are we permanently moving the bar to the left? If so 👍 since that was a pain point with v1 where the text would get obfuscated by the progress bar.

The new spinner seems to work fine with the ambiguous width option, I'll give the demo a spin on some of my VMs when I get to it :)

from gauge.

iarna avatar iarna commented on June 11, 2024

@gillesdemey Yeah, the braile spinners are keen, but mac only. But we can actually do that now.

from gauge.

iarna avatar iarna commented on June 11, 2024

@yongtw123 Thanks for the report! I'll do some testing in ConEmu. Also you're totally right about not belonging in a non-unicode theme.

(Mind, those are the darwin (read: MacOS) part of the demo you're seeing there.

from gauge.

gillesdemey avatar gillesdemey commented on June 11, 2024

Last time I tested, the braille characters worked fine on Ubuntu. Not too sure about other distros.

from gauge.

iarna avatar iarna commented on June 11, 2024

It was Ubuntu I last tested on, but it was over a year ago so it may be getting better.

from gauge.

iarna avatar iarna commented on June 11, 2024

I'm not opposed to using braille spinners on unicode-aware Linux distros if the support is there (I just want to avoid too many people seeing � in the installer =p).

from gauge.

iarna avatar iarna commented on June 11, 2024

@yongtw123 I can't reproduce your issue with ConEmu– can you try again with the latest updates?

(It may be that some themes don't work on Windows, the errors you were seeing were from the theme used for MacOS. Windows will ordinarily get what's now called the colorASCII theme by default.

from gauge.

yongtw123 avatar yongtw123 commented on June 11, 2024

@iarna Awesome! The ASCII themes seem to work correctly on my system and ConEmu. Thanks for the update.
ConEmu
2 2 1
Default CMD
2 2 1cmd

from gauge.

iarna avatar iarna commented on June 11, 2024

Ok, this all landed and is looking good. I'm going to close this and we can open something new if we want to iterate further.

from gauge.

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.