0

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.

starball
  • 20,030
  • 7
  • 43
  • 238
  • 1
    "_setting chcp.com 65001 as args for integrated terminal profile_" please show how you did that. Did you do it in your settings.json file? – starball Apr 04 '23 at 07:51
  • Like this @user "terminal.integrated.profiles.windows": { "PowerShell": { "source": "PowerShell", "icon": "terminal-powershell", "args": ["-NoExit", "/c", "chcp.com 65001"] } } – Josef Reichelt Apr 04 '23 at 12:08
  • I guess you are talking about https://stackoverflow.com/questions/74665076/how-to-fix-visual-studio-code-distorting-characters-on-windows/74665369#74665369? Yes, this indeed does not modify git bash. – Finomnis Apr 04 '23 at 14:01
  • Do you have the newest version of git bash installed? – Finomnis Apr 04 '23 at 14:02
  • The problem is there is not good way to add startup arguments to `bash`. You could do `"terminal.integrated.profiles.windows":{"Git Bash":{"path":["C:\\Program Files\\Git\\bin\\bash.exe"],"args":["-c","chcp.com 65001;bash"],"source":"Git Bash","icon":"terminal-bash"}}`, but not sure if that will work with debugging. – Finomnis Apr 04 '23 at 14:18
  • Note: If you want to change your system's default code page: https://superuser.com/q/269818/1749748. If that's a workable option for you and it solves your problem, I can write up an answer. – starball Apr 04 '23 at 17:56

1 Answers1

1

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"]

        }
    }