Terminal: Draft 2019-09 schemas are not yet fully supported terminal in settings,json

Created on 20 Sep 2020  路  17Comments  路  Source: microsoft/terminal

Everything was fine till yesterday, today all of a sudden I noticed my custom windows terminal theme showed just two colors the primary background color and font color as white for every word. Then I hover over my settings.json file I saw warning popping up in
$schemas: "https://aka.ms/terminal-profiles-schema" with warning "Draft 2019-09 schemas are not yet fully supported terminal"

Everything is working fine except some words are not highlighted in a different color, which earlier was working fine.
{66D477C5-C6BD-4F94-9373-DA06E95EAF9F}

Issue-Question Needs-Tag-Fix Resolution-Answered

Most helpful comment

I'm not sure why it shows up but might be VS Code related since it wasn't an issue before.

I guess the schema warnings started on 14 July 2020 when https://github.com/microsoft/terminal/pull/6891 was merged, even for those users who did not install newer versions of Windows Terminal.

Related: https://github.com/microsoft/vscode/issues/98724

All 17 comments

The schema error has no bearing on whether Terminal actually supports your settings. Can you share the rest of your settings.json and tell us what versions of what software you're using? It would be great to know _who is printing the colored words_ and _what version it is_ and _how you launched it_ and _what the profile configuratio n is_.

If I had to guess, I'd say you are using Windows PowerShell x86 and running into #7418. Don't make me guess.

The schema was upgraded to draft 2019-09 in https://github.com/microsoft/terminal/commit/06b50b47ca7701fd4c47bc424d810dd205596e95 (https://github.com/microsoft/terminal/pull/6891), presumably to allow "deprecated": true in the rowsToScroll property.

This rationale in the commit message looks odd, though:

I have not removed it from the schema, as I do not want to mark folks'
settings files invalid to a strict schema parser.

Because the #/definitions/Globals schema has "additionalProperties": true, I would expect validators to tolerate the rowsToScroll property in settings files even if it were removed from the schema.

Fair.

It's also been a year, so I'm surprised that our modern auto-updating text editor still carps about it. 馃榾

@DHowett You are correct while I am using Powershell syntax highlighting is working fine but it is not the case for other like Ubuntu, Cmd and Azure
here is my settings.json file

// This file was initially generated by Windows Terminal 1.2.2381.0
// It should still be usable in newer versions, but newer versions might have additional
// settings, help text, or changes that you will not see unless you clear this file
// and let us generate a new one for you.

// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
    "$schema": "https://aka.ms/terminal-profiles-schema",
    "defaultProfile": "{2c4de342-38b7-51cf-b940-2309a097f518}",
    "copyOnSelect": true,
    "copyFormatting": false,
    "profiles":
    {
        "list":
        [
            {
                "guid": "{2c4de342-38b7-51cf-b940-2309a097f518}",
                "hidden": false,
                "name": "Ubuntu",
                "source": "Windows.Terminal.Wsl",
                "colorScheme": "Andromeda",
                "startingDirectory": "C:/Users/UDIT SWAROOPA/OneDrive/UNIX"
            },
            {
                "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
                "name": "Windows PowerShell",
                "commandline": "powershell.exe",
                "hidden": false
            },
            {
                "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
                "name": "Command Prompt",
                "commandline": "cmd.exe",
                "hidden": false
            },
            {
                "guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
                "hidden": false,
                "name": "Azure Cloud Shell",
                "source": "Windows.Terminal.Azure"
            }
        ]
    },
    "schemes": [
        {
            "name": "Andromeda",
            "black": "#090300",
            "red": "#db2d20",
            "green": "#01a252",
            "yellow": "#fded02",
            "blue": "#01a0e4",
            "purple": "#a16a94",
            "cyan": "#b5e4f4",
            "white": "#a5a2a2",
            "brightBlack": "#5c5855",
            "brightRed": "#e8bbd0",
            "brightGreen": "#3a3432",
            "brightYellow": "#4a4543",
            "brightBlue": "#807d7c",
            "brightPurple": "#d6d5d4",
            "brightCyan": "#cdab53",
            "brightWhite": "#f7f7f7",
            "background": "#090300",
            "foreground": "#a5a2a2"
          }
    ],
    "keybindings":
    [
        { "command": {"action": "copy", "singleLine": false }, "keys": "ctrl+c" },
        { "command": "paste", "keys": "ctrl+v" },
        { "command": "find", "keys": "ctrl+shift+f" },
        { "command": { "action": "splitPane", "split": "auto", "splitMode": "duplicate" }, "keys": "alt+shift+d" }
    ]
}

The default shell in Ubuntu, bash, does not support syntax highlighting. Neither does CMD! you need to have a shell that supports syntax highlighting, like fish or zsh+a syntax plugin.

No, that is not the case as it was working earlier and I have not done any changes in setting see I have a screenshot
554c1262-1751-48b6-829c-d68444f2c577

I'm not seeing any syntax highlighting. That's just a colored prompt.

Can you share a screenshot of what it looks like now, when it is not working?

yeah I mean color prompt I am sorry, here is a screenshot of what is looking right now
image

So the schema error pops up regardless if you have a default settings.json or a customized one. I'm not sure why it shows up but might be VS Code related since it wasn't an issue before. I can also confirm the color prompt issue as well (but for ssh, not WSL). That may be better filed separately though.

I'm not sure why it shows up but might be VS Code related since it wasn't an issue before.

I guess the schema warnings started on 14 July 2020 when https://github.com/microsoft/terminal/pull/6891 was merged, even for those users who did not install newer versions of Windows Terminal.

Related: https://github.com/microsoft/vscode/issues/98724

Alright so the schema thing seems like a red herring to me. That's not going to be the cause of the colors not working in the terminal. Looks like for whatever reason, you color scheme isn't getting applied.

@uditswaroopa What version of the terminal are you using?

Hey, @zadjii-msft, I don't think so the schema is not applying because the schema is working fine when I am in Powershell, also I made no changes with the settings.json file this warning popped up all of a sudden. Btw this is my version 1.3.2651.0

@uditswaroopa, you could try changing to "$schema": "https://github.com/microsoft/terminal/raw/e504bf21402bca34e45863370aad9fefd543c292/doc/cascadia/profiles.schema.json". That was the last version before the schema was upgraded to draft 2019-09. If you change the schema URL like that, I think it will avoid the Draft 2019-09 schemas are not yet fully supported warning in Visual Studio Code but will not restore the prompt colors of Ubuntu in Windows Terminal. That would prove these are two separate problems.

Regarding the prompt colors, I think the PS1 shell variable is not set correctly. Login scripts should normally set it. Please run these commands in bash, to show some relevant values:

declare -p BASH_VERSION PS1 TERM
echo $-

Wait lets make sure to clear something up: "schema" != "scheme".

"schema" refers to the json schema, which provides some metadata on the json settings that editors like VsCode can use to provide error checking and autocomplete.

"scheme" refers to "color scheme", as in the set of colors that the Terminal uses to draw text with.

I concur with @KalleOlaviNiemitalo - could you run those commands?

Hello, @KalleOlaviNiemitalo thanks for the light on the issue the warning has gone which proves both are different issues.
I am uploading a screenshot of the commands you mentioned,
image

image

It looks like you're hitting this particularly plain bit of Debian's default bash configuration:

# set a fancy prompt (non-color, overwrite the one in /etc/profile)
# but only if not SUDOing and have SUDO_PS1 set; then assume smart user.
if ! [ -n "${SUDO_USER}" -a -n "${SUDO_PS1}" ]; then
  PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi

"non-color".
Something changed about your shell initialization, which isn't something Terminal (or really WSL!) controls.

It might be worthwhile to run bash -ilx and inspecting the output to determine why color_terminal isn't being detected in ~/.bashrc.

Alternatively, you may have added a .profile or .bash_profile or changed how your shell starts to strip off the --login or --interactive arguments.

It's complicated, for sure, but not something Terminal broke.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dhavalhirdhav picture dhavalhirdhav  路  56Comments

migueldeicaza picture migueldeicaza  路  58Comments

conioh picture conioh  路  65Comments

Paul-Weisser picture Paul-Weisser  路  71Comments

NOFUNEVER picture NOFUNEVER  路  106Comments