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

Draft 2019-09 schemas are not yet fully supported terminal in settings,json #7683

Closed
uditswaroopa opened this issue Sep 20, 2020 · 29 comments
Closed
Labels
Issue-Question For questions or discussion Needs-Tag-Fix Doesn't match tag requirements Resolution-Answered Related to questions that have been answered

Comments

@uditswaroopa
Copy link

uditswaroopa commented Sep 20, 2020

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}

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Sep 20, 2020
@DHowett
Copy link
Member

DHowett commented Sep 21, 2020

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.

@DHowett DHowett added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Sep 21, 2020
@DHowett
Copy link
Member

DHowett commented Sep 21, 2020

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

@KalleOlaviNiemitalo
Copy link

The schema was upgraded to draft 2019-09 in 06b50b4 (#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.

@DHowett
Copy link
Member

DHowett commented Sep 21, 2020

Fair.

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

@uditswaroopa
Copy link
Author

uditswaroopa commented Sep 22, 2020

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

@ghost ghost added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Sep 22, 2020
@DHowett
Copy link
Member

DHowett commented Sep 22, 2020

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.

@DHowett DHowett added Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something and removed Needs-Attention The core contributors need to come back around and look at this ASAP. labels Sep 22, 2020
@uditswaroopa
Copy link
Author

uditswaroopa commented Sep 23, 2020

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

@ghost ghost added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Sep 23, 2020
@DHowett
Copy link
Member

DHowett commented Sep 23, 2020

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?

@DHowett DHowett added Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something and removed Needs-Attention The core contributors need to come back around and look at this ASAP. labels Sep 23, 2020
@uditswaroopa
Copy link
Author

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

@ghost ghost added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Sep 23, 2020
@WSLUser
Copy link
Contributor

WSLUser commented Sep 24, 2020

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.

@KalleOlaviNiemitalo
Copy link

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 #6891 was merged, even for those users who did not install newer versions of Windows Terminal.

Related: microsoft/vscode#98724

@zadjii-msft
Copy link
Member

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?

@zadjii-msft zadjii-msft added Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something and removed Needs-Attention The core contributors need to come back around and look at this ASAP. labels Sep 29, 2020
@uditswaroopa
Copy link
Author

uditswaroopa commented Sep 29, 2020

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

@ghost ghost added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Sep 29, 2020
@KalleOlaviNiemitalo
Copy link

KalleOlaviNiemitalo commented Sep 29, 2020

@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 $-

@zadjii-msft
Copy link
Member

zadjii-msft commented Sep 29, 2020

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?

@zadjii-msft zadjii-msft added Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something and removed Needs-Attention The core contributors need to come back around and look at this ASAP. labels Sep 29, 2020
@uditswaroopa
Copy link
Author

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

@ghost ghost added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Sep 29, 2020
@DHowett
Copy link
Member

DHowett commented Oct 1, 2020

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.

@DHowett DHowett closed this as completed Oct 1, 2020
@DHowett DHowett added Issue-Question For questions or discussion Resolution-Answered Related to questions that have been answered and removed Needs-Attention The core contributors need to come back around and look at this ASAP. Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Oct 1, 2020
@ghost ghost added the Needs-Tag-Fix Doesn't match tag requirements label Oct 1, 2020
@fxzxmic
Copy link

fxzxmic commented Jun 23, 2021

Just change https://aka.ms/terminal-profiles-schema to https://json-schema.org/draft/2020-12/schema#https://raw.githubusercontent.com/microsoft/terminal/main/doc/cascadia/profiles.schema.json, probably because https://aka.ms/terminal-profiles-schema is not updated.
@DHowett Hope this link https://aka.ms/terminal-profiles-schema can be updated.

@KalleOlaviNiemitalo
Copy link

@fxzxmic do you mean you have "$schema": "https://json-schema.org/draft/2020-12/schema#" in your settings.json file? If so, that seems a bad idea to me, because settings.json is not a schema document.

@WSLUser
Copy link
Contributor

WSLUser commented Jun 23, 2021

Set schema in settings.json to "$schema": "https://raw.githubusercontent.com/microsoft/terminal/main/doc/cascadia/profiles.schema.json"
https://json-schema.org/draft/2020-12/schema# exists there.

@fxzxmic
Copy link

fxzxmic commented Jun 23, 2021

@KalleOlaviNiemitalo In fact, I just answered the author's questions, and I didn't study the deep technical details. After all, for warnings that just need to be removed from VSCODE, this is only the result of the URL not being updated in time.

@fxzxmic
Copy link

fxzxmic commented Jun 23, 2021

Set schema in settings.json to "$schema": "https://raw.githubusercontent.com/microsoft/terminal/main/doc/cascadia/profiles.schema.json"
https://json-schema.org/draft/2020-12/schema# exists there.

You can do that too, but the URL is too long. 🤣

@WSLUser
Copy link
Contributor

WSLUser commented Jun 23, 2021

It's just a copy and paste.....plus that ensures you get the latest updates for the schema, in case the shortened URL isn't updated. For example, I made an update yesterday that shows there now.

@fxzxmic
Copy link

fxzxmic commented Jun 23, 2021

It's just a copy and paste.....plus that ensures you get the latest updates for the schema, in case the shortened URL isn't updated. For example, I made an update yesterday that shows there now.

Well, you're right.

@DHowett
Copy link
Member

DHowett commented Jun 23, 2021

@DHowett Hope this link https://aka.ms/terminal-profiles-schema can be updated.

Hmm. This link is supposed to track the state of the schema at the time that we made the stable release. I can backport the schema version change to it, but I cannot wholesale update it to be the latest version as it would contain settings that do not work in (current stable version) 1.8.

@fxzxmic
Copy link

fxzxmic commented Jun 23, 2021

@DHowett Hope this link https://aka.ms/terminal-profiles-schema can be updated.

Hmm. This link is supposed to track the state of the schema at the time that we made the stable release. I can backport the schema version change to it, but I cannot wholesale update it to be the latest version as it would contain settings that do not work in (current stable version) 1.8.

Does that mean it also contains settings that don't work in version 1.9? Because it's the same in 1.9 and 1.8.

"$schema": "https://json-schema.org/draft/2019-09/schema#",

"$schema": "https://json-schema.org/draft/2019-09/schema#",

But for VScode, it needs https://json-schema.org/draft/2020-12/schema#. So is VScode too far ahead?

@DHowett
Copy link
Member

DHowett commented Jun 23, 2021

That just means that we didn't get a fix for us using an unacceptable version of the json-schema draft schema in time for 1.9. 😄

@arunsingh28

This comment has been minimized.

@DHowett

This comment has been minimized.

@microsoft microsoft locked and limited conversation to collaborators Dec 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Issue-Question For questions or discussion Needs-Tag-Fix Doesn't match tag requirements Resolution-Answered Related to questions that have been answered
Projects
None yet
Development

No branches or pull requests

7 participants