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

Windows support #5

Open
amitmerchant1990 opened this issue Jun 23, 2016 · 28 comments
Open

Windows support #5

amitmerchant1990 opened this issue Jun 23, 2016 · 28 comments

Comments

@amitmerchant1990
Copy link

I've tried to use it on Windows 7 and it appears to be not working correctly. All I can see is below
capture

Node.js version 4.4.5.

@CodeDotJS
Copy link
Contributor

CodeDotJS commented Jun 23, 2016

If you are unable to read Unicode characters, it may be because your system is not properly configured.
You need to change the font style of your console.

@sindresorhus
Copy link
Owner

sindresorhus commented Jun 23, 2016

The default Windows terminal font doesn't support unicode and unlike macOS, the terminal doesn't fall back to other fonts that do have such character.

I would strongly recommend using Bash for Windows instead. If it still doesn't display properly you might need to download a good fallback font. I'd recommend Segoe UI or downloading the Noto Color Emoji font and setting it as your terminal font. Could you all try that?

@sindresorhus sindresorhus changed the title Windows issue Windows support Jun 23, 2016
@nolanlawson
Copy link

Bash for Windows doesn't show the emoji either. Explorer also complains that Noto Color Emoji is not a valid TTF file (googlefonts/noto-emoji#43). Ah, Windows problems. 😕

@sindresorhus
Copy link
Owner

@jdalton
Copy link

jdalton commented Jun 24, 2016

\cc @bitcrazed

@adueck
Copy link

adueck commented Jun 24, 2016

Works ok-ish with Git Bash for Windows
https://git-scm.com/download/win

@sindresorhus
Copy link
Owner

@adueck Can you share a screenshot?

@rwxdash
Copy link

rwxdash commented Jun 26, 2016

I'm on windows too. I get this error when I try to run on git bash.

git version 2.9.0.windows.1, npm --version 3.3.12, node --version v5.4.1

C:\Users\...\AppData\Roaming\npm\node_modules\emoj\cli.js:36
process.stdin.setRawMode(true);
              ^

TypeError: process.stdin.setRawMode is not a function
    at Object.<anonymous> (C:\Users\...\AppData\Roaming\npm\node_modules\emoj\cli.js:36:15)
    at Module._compile (module.js:397:26)
    at Object.Module._extensions..js (module.js:404:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Function.Module.runMain (module.js:429:10)
    at startup (node.js:139:18)
    at node.js:999:3

@bitcrazed
Copy link

Thanks for looping me in :)

Running in Bash on Ubuntu on Windows in Windows 10 Insiders build 14374, I see this:
image

Alas, this highlights the fact that emoji support is currently very limited by the Windows Console. We have plans to fix this in the future, but for now, alas we don't support emoji's sufficiently to make emoj work :(

This said, if you would like to see us improve our emoji support in the future, please do upvote some of these issues in our UserVoice: https://wpdev.uservoice.com/forums/266908-command-prompt-console/category/161892-bash?query=UTF-8

@adueck
Copy link

adueck commented Jun 27, 2016

@aoozdemir Yes, it does that when you try to run it without any argument, in interactive mode. Git Bash has some kind of problem working with with interactive node cli apps. When you install Git Bash it it tells you this and explains some other service that you can use to run those interactive cli apps. There is a way to do this, but I forgot what this is and I can't find it in the documentation. 😢

So I just run it with the argument in the initial command ie. emoji 'text you want to use'

And it seems to work pretty well. (using the default font, consolas) Here's a screenshot. @sindresorhus

screenshot

@rwxdash
Copy link

rwxdash commented Jun 27, 2016

Ahh! Win terminal bothers me so much lately. ☺ I believe it's time for a brand new, beautiful terminal for Windows (especially for Win10).

@bitcrazed
Copy link

@aoozdemir Are you running the Win10 insiders builds? We've made A LOT of really big improvements to the Console, including big perf improvements, better High-DPI support, lots more VT sequence support (not done yet, but lots done):
8-split-cacademo.

We are continuing to invest in improving our console experience. We have big plans for the future, but please bear-with us while we figure out how to deliver against the demands of so many customers ;)

@bitcrazed
Copy link

@adueck You're seeing some additional features that the Cygwin/MinGW team added to how they handle font-fallback.

Alas, we cannot add this mechanism to the built-in Windows console this time around, but we have several items on our backlog to fix a number of the issues that prevent us from being able to support many globalization/localization issues, including emoji!

@rwxdash
Copy link

rwxdash commented Jun 27, 2016

@bitcrazed no I didn't sign up for the insider program. That's great to hear, actually. I'm looking forward to try it out. 🎉

(I'm not sure if it's on the table but, tabs would be so cool to have 😄)

@bitcrazed
Copy link

Tabs ... and MANY, MANY other features ;)

@13rac1
Copy link

13rac1 commented Jul 13, 2016

Explorer also complains that Noto Color Emoji is not a valid TTF file

@nolanlawson It only contains CBLC/CBDT color glyphs. It doesn't have any b&w regular glyphs which makes it an invalid font. FontForge can't work with it either, it's not just a Windows problem. :)

My emoji fonts have SVGinOT color and b&w regular glyphs. They work fine on Windows, although only show color only in Firefox.

@yincrash has created a method to make my EmojiOne-based font replace the Windows default emoji: https://github.com/eosrei/emjione-color-font/pull/47 I doubt it will solve this issue, but could help. Happy to answer any other questions.

@yincrash
Copy link

yincrash commented Jul 13, 2016

Unfortunately, Windows 7 which is my and @amitmerchant1990's OS does not support Bash for Windows.

Additionally, cmd.exe (which uses conhost.exe) doesn't really support Unicode. It uses code pages 😱 (and UCS-2 under the hood). This means you have to change the code page whenever you want something outside your current code page (437 for Americans), and switching to the "UTF-8" (65001) codepage doesn't really work well, plus it for sure does not support anything outside the BMP such as most Emoji.

MSYS2 (and MINGW / Git Bash for Win) shell does support Unicode because they use Cygwin's mintty, so they aren't real Windows consoles (using conhost.exe), to normal windows (non-msys2/mingw packages), they are seen to apps like python and node as pipes and not as a console output, which is why interactive interpreters often fail in it. However, if you're using the MSYS2/MinGW version of python it does act like it's POSIX counterpart and outputs Emoji to the shell. I couldn't find a MSYS2 version of nodejs outside of 0.10.x version to test the emoj package.

Here's a screenshot of MSYS2 python displaying emoji when I set the console font to the B&W Noto Emoji. It doesn't seem that they use Window's fallback mechanisms for fonts, so you'd have to merge a nice console font with an emoji font using FontTools or some other tool to get emoji working nicely.

python-msys2-emoji

tl;dr - windows console is a nightmare & regular windows nodejs will not display emoji to the console :(

@bitcrazed
Copy link

Thanks for the feedback. As the PM for Windows Console/ConHost and Bash experience, I appreciate your candor and can confirm that we are keenly aware of these and many other limitations that limit Console's value and cause frustration.

Rest assured that we are working hard to fix things and I think that you'll see a lot of under the covers improvements in Win10AU, when you do upgrade (please consider doing so if you can; not only is the free upgrade offer expiring soon, but you're missing out on a lot of really great improvements that'll make your experience much better).

@yincrash
Copy link

Oh I understand why it's like that, and legacy support is one of the biggest reasons I love Windows. It's really awesome the WSL is being developed to help include the Linux ecosystem better. I don't think the Win32 API designers originally expected us to use code points outside of UCS-2 very much in the console, and I don't fault them for that.

@bitcrazed
Copy link

@yincrash Yeah, NT implemented Unicode support VERY early in its development and in many areas (e.g. Console) has not done a good job of keeping up to date with improvements like UTF-8. We're aiming to fix that in future releases :)

@nnmrts
Copy link

nnmrts commented Jun 7, 2020

I'm not a Windows user, but shouldn't this be fixed by now by the Windows "Terminal" that was released in 2019? Powershell should be able to display emoji too, I think.

I would also suggest changing the readme so windows users don't think they can't use this.

@HLFH
Copy link

HLFH commented Jun 7, 2020

I'm not a Windows user, but shouldn't this be fixed by now by the Windows "Terminal" that was released in 2019? Powershell should be able to display emoji too, I think.

Nope. microsoft/terminal#190

@bitcrazed
Copy link

@HLFH The issue you refer to is an issue in the legacy Windows Console, not the Windows Terminal.

Windows Terminal is a new modern Terminal app in which we will implement all the features you and we want and need of a modern terminal app, including our new DirectX based text rendering engine that can display an ever increasing number of emoji and unicode glyphs:

image

However, Windows Console & Cmd shell's primary job is to preserve backward compatibility with legacy scripts, apps, and tools. As such, we avoid changing Console (and especially Cmd) unless we have to. When we do have to make a change, we have to take enormous care not to break anything - and you wouldn't believe the things that break when we make the smallest change to Console/Cmd!

This said, one of the key goals of implementing Terminal in native C++ was our ability to utilize and share code between Console and Terminal. We do have a goal of introducing Terminal's new text handling and text layout/rendering engines, along with the supporting technologies inc. our accessibility engine once sufficiently complete, stable, and performant enough. However, as you can imagine, this will take a little time.

This said, we do intend to introduce Terminal's text layout and rendering engine to Console which will enable it to display emoji and most unicode glyphs. However, before we can do that, we have to do the hard work. Stay tuned.

@nnmrts
Copy link

nnmrts commented Jun 9, 2020

I'd really recommend avoiding cmd.exe as the main shell as a developer in 2020 though. Seriously, do yourself a favour and use a modern terminal emulator like the Windows Terminal, Powershell, hyper, etc... any of those.

Don't expect Emoji support from a decades old application that just got Unicode support as recently as October 2018. Don't expect anything from it other than itself "just working". Because that's basically the only purpose of it today.

@hackdefendr
Copy link

Windows Terminal latest version works close enough without special fonts. Works even better with the correct fonts.

@charlesroper
Copy link

Works great in Windows Terminal with PowerShell.

emoj-on-windows

@bitcrazed
Copy link

@nnmrts A few clarifications:

I'd really recommend avoiding cmd.exe as the main shell as a developer in 2020 though.

Couldn't agree more - Windows developers should be using PowerShell these days 😜

https://twitter.com/bitcrazed/status/1387520440529080321?s=20&t=DQspE6JWijN3OJpjuJpKbg
image

Seriously, do yourself a favour and use a modern terminal emulator like the Windows Terminal, Powershell, hyper, etc... any of those.

Cmd and PowerShell are command-line shells and operate independently from the terminal used to command them.

Windows Terminal (and the legacy Console/ConHost) are terminals.

Many might find this series of blogs I wrote useful/interesting: https://devblogs.microsoft.com/commandline/windows-command-line-backgrounder/

Don't expect Emoji support from a decades old application that just got Unicode support as recently as October 2018.

Windows NT, upon which modern Windows is based, implemented 16-bit UCS-2 back in 1989 before there even was a Unicode standard, and long before UTF-8 was created.

Don't expect anything from it other than itself "just working". Because that's basically the only purpose of it today.

As Charles points out, emoji works well on Windows Terminal 😁

@moegi29
Copy link

moegi29 commented Sep 30, 2023

I really like your npm !! :)
"Works best on macOS and Linux in readme.md." However, there are some emojis that do not output in the WSL2 Ubuntu 20.04 environment, so please fix them if you like. I would be happy if you could add that some emojis are not output on Ubuntu 20.04. :) Thanks.
スクリーンショット-2023-09-30-151511

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests