2

Why is my VSCode integrated terminal not able to show correct emojis:

Text file:

 Emoji

which produces with cat file.txt the output:

� Emoji

I use a proper UTF8 font MesloLGS NF (pk10 powerline font). I use git-bash.exe. Starting git-bash.exe from the task bar (mintty terminal?) works fine with these emojis. Also 3 bytes emojis work.

Any clue very welcome.

Gabriel
  • 8,990
  • 6
  • 57
  • 101
  • What's the difference for `locale -a` in mintty and vscode ? – Philippe Mar 02 '21 at 19:35
  • What's output from `hexdump -C -n 10 file.txt`? Maybe there is a BOM? – JosefZ Mar 02 '21 at 21:05
  • What shell are you using in your VS Code integrated terminal? The default is PowerShell, but you can change it to Git Bash by following the directions at https://code.visualstudio.com/docs/editor/integrated-terminal#_windows. Often UTF-8 issues are solved by switching from PowerShell (or CMD) to Git Bash. Also try putting `export TERM=xterm` in your ~/.bash_profile. I've written a bit about this at https://www.ii.com/git-bash-is-my-preferred-windows-shell/ – n m Mar 03 '21 at 16:21
  • 1
    I have this issue too and I'm really curious about this. Here's a possible clue: If you run `chcp.com` in VS Code terminal running Git Bash, it displays `Active code page: 437`. In mintty, `chcp.com` displays `Active code page: 65001`. In VS Code's terminal I ran `chcp.com 65001` but still get the box question mark character. There's some kind of weird emoji sequence/code page/encoding/UTF-8/UTF-16 thing going on here and I'm wondering if this should be posted in the VS Code GitHub Issues? – n m Mar 06 '21 at 17:55

1 Answers1

0

Changing codepage to chcp.com 65001 and using the newest VS Code cat A.txt with content Emoji works.

Gabriel
  • 8,990
  • 6
  • 57
  • 101