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

MEGATHREAD: Breaking settings changes in version 0.11! #5458

Closed
DHowett-MSFT opened this issue Apr 22, 2020 · 72 comments
Closed

MEGATHREAD: Breaking settings changes in version 0.11! #5458

DHowett-MSFT opened this issue Apr 22, 2020 · 72 comments
Labels
Area-Settings Issues related to settings and customizability, for console or terminal Issue-Question For questions or discussion Needs-Tag-Fix Doesn't match tag requirements Product-Terminal The new Windows Terminal.

Comments

@DHowett-MSFT
Copy link
Contributor

DHowett-MSFT commented Apr 22, 2020

BREAKING SETTINGS CHANGES IN 0.11


Do your settings look like this?

{
    "globals": {
        "defaultProfile": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
        "initialCols": 200,
        "initialRows": 65,
        "initialPosition": "0,0",
        "wordDelimiters" : " ()\"'-:,;<>~!@#$%^&*|+=[]{}~?\u2502",
        "confirmCloseAllTabs": true,
        "keybindings": [
            ...
        ]
    },
    "profiles": {
        ...
    }
}

Then change them to look like this:

{
    "defaultProfile": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
    "initialCols": 200,
    "initialRows": 65,
    "initialPosition": "0,0",
    "wordDelimiters" : " ()\"'-:,;<>~!@#$%^&*|+=[]{}~?\u2502",
    "confirmCloseAllTabs": true,
    "keybindings": [
        ...
    ],
    "profiles": {
        ...
    }
}

Or even better, make a backup of your settings file, and delete the contents entirely. We'll re-generate the file with some better formatting and more sane defaults, and you can copy the modifications you want back in.

@DHowett-MSFT DHowett-MSFT added Issue-Question For questions or discussion Area-Settings Issues related to settings and customizability, for console or terminal Product-Terminal The new Windows Terminal. labels Apr 22, 2020
@ghost ghost added the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Apr 22, 2020
@DHowett-MSFT DHowett-MSFT pinned this issue Apr 22, 2020
@DHowett-MSFT DHowett-MSFT removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Apr 22, 2020
@DHowett-MSFT DHowett-MSFT modified the milestone: Terminal v1.0 Apr 22, 2020
@DHowett-MSFT DHowett-MSFT changed the title MEGATHREAD: My settings are gone! My default profile stopped bring default! I hate this! MEGATHREAD: My settings are gone! My default profile broke! I hate this! Apr 22, 2020
@DHowett-MSFT DHowett-MSFT changed the title MEGATHREAD: My settings are gone! My default profile broke! I hate this! MEGATHREAD: DEFAULT PROFILE STOPPED WORKING! My settings are gone! I hate you! Apr 22, 2020
@DHowett-MSFT DHowett-MSFT changed the title MEGATHREAD: DEFAULT PROFILE STOPPED WORKING! My settings are gone! I hate you! MEGATHREAD: DEFAULT PROFILE STOPPED WORKING! Settings are gone! I hate you! Apr 22, 2020
@mlewand
Copy link

mlewand commented Apr 23, 2020

Out of curiosity, any reason why settings.json's global values weren't moved automatically to the root level after the upgrade? You migrate the config on multiple occasions which is good, but not this time.

I myself had this problem and got into #5489 even though I scanned changelog before the upgrade, but haven't picked up that I have actually to change something in my config 🙂

@bmarkovic
Copy link

bmarkovic commented Apr 23, 2020

If you had settings hanging out in the globals dictionary, you'll want to move them out.
Failure to do so will cause us to ignore your default profile, launch mode, etc., etc.
THIS INCLUDES defaultProfile

You might want to reword that from "move them out" as that really doesn't say nearly enough to anyone. Be specific:

...you will need to move them to the root object of the settings.json.

@DHowett-MSFT
Copy link
Contributor Author

@bmarkovic that’s a great suggestion, thank you. I appreciate that you edited your comment.

@bmarkovic
Copy link

In my particular case this didn't restore functionality of keybindings, did something change about the format (or the JSON key name)?

@DHowett-MSFT
Copy link
Contributor Author

Interesting. If you scroll down, do you happen to have a separate copy of keybindings? That may be an obnoxious gotcha on top of all this ☹️

@bmarkovic
Copy link

bmarkovic commented Apr 23, 2020

Unfortunately, no.

I see in #3600 that "command" is an object now, is that mandatory (i.e. the old format where "command" is string no longer works)?

Also in my config, "keys" is an array, here it is a string.

E.g.

        {
            "command" : "newTab",
            "keys" : 
            [
                "ctrl+t"
            ]
        },

@DHowett-MSFT
Copy link
Contributor Author

Nah, action+command (the object format) isn’t mandatory, and keys can be either a string or an array... Would you mind sharing a gist of your settings?

@bmarkovic
Copy link

bmarkovic commented Apr 23, 2020

Off course not.

https://gist.github.com/bmarkovic/485363256672f4be66379c4d9a604c81

Edit: In case someone else comes along with an issue like this, the issue is that A LOT of these settings have changed and are no longer valid. If you are using VS.Code it will respect the new JSON schema, underline the things that are no longer valid, and you will have to refer to:

https://github.com/microsoft/terminal/blob/master/doc/cascadia/SettingsSchema.md

for the format of the new settings.

@DHowett-MSFT
Copy link
Contributor Author

DHowett-MSFT commented Apr 23, 2020

Ah, I'm gonna guess that the key bindings that aren't working are the Ctrl+Shift+# ones. Sorry our documentation failed you here -- those are included in the legacy settings removal from #5190. Right now, I think those old bindings are replacing the default bindings with their no-longer-effective legacy versions and you can just delete them.

Here's a better way out, though:

Judging by all the key bindings, the format, and the profiles containing every config option, it looks like that settings file predates 0.2. I really think it's great that you've been with us that long (since our first public release!) Thanks! Versions of Terminal after 0.5 lay down a cool new settings template that's more streamlined, and is a bit better-documented. There's a set of "default" settings now that live in the terminal package that your settings get applied on top of.

It's not a requirement by any means, but you might be a bit happier in general if you spend a couple minutes migrating.

  1. move your old settings file aside
  2. let Terminal make a new one (automatic on startup)
  3. copy over key bindings that you care about (since you're using pre-0.2 settings, you might care that Ctrl+W and Ctrl+T are bound to close/open tab (which was a bad decision we made almost a whole year ago).
  4. copy over some profiles you care about.

The settings model change from 0.5 means you don't need to specify every option in every profile, and you don't need to be quite so aggressive in customizing everything.

I took a stab at it -- this should be equivalent to your old settings, but with a whole bunch of the legacy cruft removed.

https://gist.github.com/DHowett-MSFT/ec2d24cf2b84e1555fb56a1192e4fb94

I didn't know if you used alt+N for switching tabs, but those were some of the old key bindings in your settings and I didn't want to go stomp them 😄
A bunch of your "duplicated" settings got moved into the "defaults" group.. cuts down on repetitive lines for sure.

@DHowett-MSFT
Copy link
Contributor Author

DHowett-MSFT commented Apr 23, 2020

The hallmark of an old (version 0.2) settings file is ctrl+w being bound, and being bound to closeTab (it closes the whole tab, even if there's panes inside it). The modern binding is Ctrl+Shift+W for closePane, which only closes the active focused pane.

@bmarkovic
Copy link

Hah, I've done it myself too in the meantime (I updated the alt+ tab switches, as I did use them) as well. I will take a look at your take on it too. This machine is not really my day-job driver (contrary to, I guess, most people, the Windows box is a play thing, and I earn my bread and butter on a Linux desktop) so that might be why I've not updated all this before.

Here is a pretty verbatim translation of my settings file to new schema (with a change here and there to make use of some new, previously unavailable settings), from my quick test they all do work after I change the target commands and format. I'll look at the "no-legacy cruft" version you pasted as well (I don't want get attached my non-standard bindings) and probably make some combo for future use.

Thank you for the help, and I do love the program. It has completely replaced ConEmu as the go-to terminal emulator on Windows for me.

@DHowett-MSFT
Copy link
Contributor Author

Thank you for the help, and I do love the program. It has completely replaced ConEmu as the go-to terminal emulator on Windows for me.

Happy to hear that, and I'm sorry it's been a bit of a bumpy ride here on the preview train 😅

@Luuk34

This comment has been minimized.

@DHowett-MSFT

This comment has been minimized.

@afmsavage
Copy link

What a pain. Appreciate the commenting in the new generated settings.json but a straight copy/paste from the older version doesn't work. Cannot get color schemes working and now they are forcing you to have an enabled Azure Cloud Shell profile enabled. Comment it out, save, and it pops right back in.
image

@zadjii-msft
Copy link
Member

From #5611

Wow, if you had colorscheme in your settings file, you must have installed the Terminal an exceptionally long time ago. Thanks for sticking with us for so long through the preview process ❤️!

As you've found out, the colorscheme key was deprecated in favor of colorScheme. Largely, we're tracking all the "upgrade to 0.11 broke my settings" bugs with #5458, so I'm gonna close this thread as a duplicate.

Thanks!


Maybe try changing "hidden": false 🤔 from #5684:

👉 NOTE: On launch, if a dynamic profile generator is enabled, it will always add new profiles it detects to your list of profiles. If you delete a dynamically generated profile from your list of profiles, it will just get re-added the next time the Terminal is launched! To remove a dynamic profile from your list of profiles, make sure to set "hidden": true in the profile.

@tomm1e
Copy link

tomm1e commented May 5, 2020

Is black the new default? The regenerated settings.json does not contain any color schemes.

@zadjii-msft
Copy link
Member

@tomm1e That's entirely intentional. We figured that every user didn't need to see a full copy of every default scheme in their settings file, so we moved them to defaults.json. You can still use the schemes in that file.

@ashemedai
Copy link

So upon a fresh install of Terminal the settings.json file contains a bunch of URL references. However, most of them lead nowhere useful. Can these changes be made for the sake of people actually trying these URLs since 1.0 is approaching? :)

ref URL leads to should be
https://aka.ms/terminal-documentation https://github.com/microsoft/terminal/blob/master/doc/user-docs/index.md https://github.com/microsoft/terminal/blob/master/doc/user-docs/UsingJsonSettings.md
https://aka.ms/terminal-global-settings https://github.com/microsoft/terminal/blob/master/doc/user-docs/index.md https://github.com/microsoft/terminal/blob/master/doc/user-docs/UsingJsonSettings.md#global-settings
https://aka.ms/terminal-profile-settings https://github.com/microsoft/terminal/blob/master/doc/user-docs/index.md https://github.com/microsoft/terminal/blob/master/doc/user-docs/UsingJsonSettings.md#profiles
https://aka.ms/terminal-color-schemes https://github.com/microsoft/terminal/blob/master/doc/user-docs/index.md https://github.com/microsoft/terminal/blob/master/doc/user-docs/UsingJsonSettings.md#color-schemes
https://aka.ms/terminal-keybindings https://github.com/microsoft/terminal/blob/master/doc/user-docs/index.md https://github.com/microsoft/terminal/blob/master/doc/user-docs/UsingJsonSettings.md#key-bindings
https://aka.ms/terminal-selection https://github.com/microsoft/terminal/blob/master/doc/user-docs/index.md https://github.com/microsoft/terminal/blob/master/doc/user-docs/index.md#selecting-and-copying-text-in-windows-terminal
https://aka.ms/terminal-panes https://github.com/microsoft/terminal/blob/master/doc/user-docs/index.md ?

@zadjii-msft
Copy link
Member

Those links are going to go somewhere useful SoonTM. Please bear with us as we put the finishing touches on the actual docs 😉

@ashemedai
Copy link

@zadjii-msft Thanks for that update. Being a technical writer myself I always gets antsy when documentation seems to be forgotten. 😅

@pecigonzalo
Copy link

pecigonzalo commented May 12, 2020

I noticed the blog article talks about using things like { "command": { "action": "copy", "singleLine": true ), "keys": "ctrl+alt+c" } to restore the single line copy functionality, but no indication on how to restore it to copy on select as it was previously done by copyFormatting. Is it possible to copy as single line but leave copyFormatting: false?

eg.

  • Select text that breaks into multiline due to window size
  • Paste with ctrl-shift-v
  • It breaks into newlines

We should document this as IMO its not clear that copyFormatting affects single line paste and if possible, how to fix it.

@DHowett-MSFT
Copy link
Contributor Author

copyFormatting doesn't impact single-line paste or copy on select. copyOnSelect impacts copy on select.

Text that is broken into newlines due to window size is doing so because of a bug, and the solution isn't to set singleLine to true.

Do you have a specific repro that causes broken multiline text?

@DHowett-MSFT
Copy link
Contributor Author

(There are three independent copy flags. copyOnSelect determines whether text is copied when you release the left mouse button, copyFormatting determines whether text is copied with color information and singleLine determines whether all newlines are deleted, even if they were intentional.)

@pecigonzalo
Copy link

pecigonzalo commented May 12, 2020

@DHowett-MSFT I understand that to be the case regarding the different options, but it seems then there is a bug that affect that and its "fixed" by setting copyFormatting to true.

Repro for me is really simple for me and I can even dynamically toggle that and have it broken/fixed.

~
❯ echo this is a really long command that shouldnotbe breaking when copy paste
this is a really long command that shouldnotbe breaking when copy paste

~
❯ echo this is a really long command that shouldnotbe breakin

this is a really long command that shouldnotbe breakin

~
❯ g when copy paste
git: 'when' is not a git command. See 'git --help'.

The most similar commands are
        clean
        clone
        prune
        shell

~
❯

As you can see on that output, the line when pasted is split into multi line and ran as 2 commands.

  • Type a really long line that breaks to multi-line in your console (or make a smaller console)

  • Select text

  • Paste as ctrl+shif+v or ctrl-v or right click or whatever is your paste

  • It runs 2 commands

  • Toggle copyFormatting to true

  • Do the same

  • Does not break

Please note im not copying with ctrl+c or ctrl+shift+c but with copy on select.

For reference, this is my relevant config:

{
  "$schema": "https://aka.ms/terminal-profiles-schema",
  "defaultProfile": "{01751d96-d6f8-573f-8029-e581f2f7c955}",
  "copyFormatting": false,
  "profiles": {
    "defaults": {
      "historySize": 9001,
      "fontFace": "Fira Code",
      "fontSize": 12,
      "useAcrylic": true,
      "acrylicOpacity": 0.85
    },
    "list": [
      ...
    ]
  },
  "schemes": [
    ...
  ],
  "keybindings": [
    {
      "command": {
        "action": "copy",
        "singleLine": true
      },
      "keys": "ctrl+c"
    },
    {
      "command": {
        "action": "adjustFontSize",
        "delta": -1
      },
      "keys": "ctrl+-"
    },
    {
      "command": {
        "action": "adjustFontSize",
        "delta": 1
      },
      "keys": "ctrl+="
    }
  ]
}

@pecigonzalo
Copy link

pecigonzalo commented May 12, 2020

Ok, oddly enough while I just did this while creating this comment and it caused the output I pasted (broken line) and it happened multiple times since the update. I just ran it once again after, just to check other cases and it worked correctly, which has me really confused now.

@EverlyScott
Copy link

Any reason why we haven't gotten a GUI for changing settings yet?

@DHowett
Copy link
Member

DHowett commented May 17, 2020

@ScribbleNerd because that will take months of work that we couldn't complete until we nailed the basics of actually being a terminal? That work is being tracked in #1564.

@exitdown
Copy link

exitdown commented May 17, 2020

yeah not meaning to sound condescending but its a cli tool for cli competent people, so it makes far more sense to work on the core functionality and cli user features rather than trying to make it easy point and click to make pretty - at least until all the main things are done, upvote for html link handler haha

@ashishpawar517
Copy link

I only changed the default profile to cmd.exe in last version. then today after update it showing me global deprecated error over and over again.

@warpdesign
Copy link

warpdesign commented Jun 1, 2020

How about automatically converting the file if older format is detected: seeing the format changes it appears to be possible.

Seeing how full of comments is this issue I think this could solve problems for a lot of people.

@garethj-msft
Copy link
Member

Got to say, I found this extremely jarring for a product that that is at GA status.
Auto-migrating such things seems a pretty bare minimum for a breaking change release.

@DHowett
Copy link
Member

DHowett commented Jun 10, 2020

is at GA status

Only people who were using the Preview build will encounter breaking changes. The preview build was offered with no warranties (express or implied.)

I’m sorry it was jarring. Settings migration is planned for any updates to the stable channel that require settings model changes.

@DHowett DHowett unpinned this issue Jun 30, 2020
@microsoft microsoft locked as resolved and limited conversation to collaborators Jul 9, 2020
@DHowett DHowett closed this as completed Jul 9, 2020
@ghost ghost added the Needs-Tag-Fix Doesn't match tag requirements label Jul 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Area-Settings Issues related to settings and customizability, for console or terminal Issue-Question For questions or discussion Needs-Tag-Fix Doesn't match tag requirements Product-Terminal The new Windows Terminal.
Projects
None yet
Development

No branches or pull requests