Search code examples
bashvisual-studio-coderustunicodevscode-debugger

Unicode not showing properly in git-bash when debugging in Visual Studio Code


I tried debugging a cli app in rust. Running it with any profile for integrated terminal caused it to show incorrect characters for box drawings

It showed "ÔöÇÔöÔÇöÇÔöÇ" instead of "────────────".

Setting chcp.com 65001 as args for integrated terminal profile did fix it for cmd and PowerShell, couldn't get it to work for Git Bash

And when I tried opening it up in external terminal (using Windows Terminal) it always opened up with CMD even though I have a default profile set to Git Bash for both VS Code and Windows Terminal.

Running the program itself manually in windows terminal works as expected.

I tried to debug TUI application in VS Code and expected to show properly.


Solution

  • Thanks to @Finomnis I was missing the extra bash arg in the args. Now it sort of works

    Full object:

    "terminal.integrated.profiles.windows": {
            "PowerShell": {
                "source": "PowerShell",
                "icon": "terminal-powershell",
                "args": ["-NoExit", "/c", "chcp.com 65001"]
            },
            "Command Prompt": {
                "path": [
                    "${env:windir}\\Sysnative\\cmd.exe",
                    "${env:windir}\\System32\\cmd.exe"
                ],
                "args": ["-NoExit", "/c", "chcp.com 65001"],
                "icon": "terminal-cmd"
            },
            "Git Bash": {
                "source": "Git Bash",
                "env": {
                    "LANG": "C.UTF-8"
                },
                "args": ["-c","chcp.com 65001;bash"]
    
            }
        }