Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect new Windows terminal #27

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,13 @@ if (platform === 'linux') {
main.questionMarkPrefix = '?';
}

const figures = platform === 'win32' ? windows : main;
const figures = platform === 'win32' ? process.env.WT_SESSION ? main : windows : main;

if (platform === 'win32' && process.env.WT_SESSION) {
// The main ones doesn't look that good on Ubuntu
main.questionMarkPrefix = '?';
main.circleQuestionMark = '(?)';
}

const fn = string => {
if (figures === main) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "figures",
"version": "3.0.0",
"version": "3.1.0",
"description": "Unicode symbols with Windows CMD fallbacks",
"license": "MIT",
"repository": "sindresorhus/figures",
Expand Down
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
[*and more...*](index.js)

Windows CMD only supports a [limited character set](http://en.wikipedia.org/wiki/Code_page_437).
The new Windows terminal fully supports Unicode symbols.


## Install
Expand Down
2 changes: 1 addition & 1 deletion test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import test from 'ava';
import figures from '.';

const result = (main, windows) => process.platform === 'win32' ? windows : main;
const result = (main, windows) => process.platform === 'win32' ? process.env.WT_SESSION ? main : windows : main;

console.log(' ' + Object.keys(figures).map(symbol => figures[symbol]).join(' ') + '\n');

Expand Down