Comments (15)
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.
Mentioned elsewhere:
https://github.com/sindresorhus/elegant-spinner
https://github.com/helloIAmPau/node-spinner/blob/master/index.js#L13-L32
from gauge.
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.
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.
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.
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'.
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.
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
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.
@gillesdemey Yeah, the braile spinners are keen, but mac only. But we can actually do that now.
from gauge.
@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.
Last time I tested, the braille characters worked fine on Ubuntu. Not too sure about other distros.
from gauge.
It was Ubuntu I last tested on, but it was over a year ago so it may be getting better.
from gauge.
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.
@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.
@iarna Awesome! The ASCII themes seem to work correctly on my system and ConEmu. Thanks for the update.
ConEmu
Default CMD
from gauge.
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)
- New line before progress bar? HOT 6
- Disable if running in CI HOT 1
- Misspelling in Description, should be "gauge"
- Progress bar theme set to 'fallback' regardless of unicode locale on Fedora Linux HOT 5
- Make new release HOT 2
- npm does not store tarball URL in lockfile
- [BUG] Cannot find module 'object-assign' HOT 2
- [FEATURE] Dependencies should be updated to dedupe the tree for npm HOT 2
- [Question] Upgrade Dependencies to fix Vulnerability HOT 16
- [BUG] Themes no longer work from require
- Reporting a vulnerability HOT 1
- Image in readme is out of date!! HOT 1
- every time I use it, I expect show to pulse too HOT 1
- Display corruption on node 0.10/0.12 on Windows
- Progress bar not color with invert ansi/vt100 code in cmd.exe
- Temporary files on npm release HOT 4
- Am I using gauge wrong?
- MaxListenersExceededWarning HOT 4
- TypeError: Object.keys called on non-object HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gauge.