terminal/doc/user-docs/ThirdPartyToolProfiles.md
Dustin L. Howett (MSFT) 64489b1ec1
rename profiles.json to settings.json, clean up the defaults (#5199)
This pull request migrates `profiles.json` to `settings.json` and removes the legacy roaming AppData settings migrator.

It also:

* separates the key bindings in defaults.json into logical groups
* syncs the universal terminal defaults with the primary defaults
* removes some stray newlines that ended up at the beginning of settings.json and defaults.json

Fixes #5186.
Fixes #3291.

### categorize key bindings

### sync universal with main

### kill stray newlines in template files

### move profiles.json to settings.json

This commit also changes Get*Settings from returning a string to
returning a std::filesystem::path. We gain in expressiveness without a
loss in clarity (since path still supports .c_str()).

NOTE: I tried to do an atomic rename with the handle open, but it didn't
work for reparse points (it moves the destination of a symbolic link
out into the settings folder directly.)

(snip for atomic rename code)

```c++
auto path{ pathToSettingsFile.wstring() };
auto renameBufferSize{ sizeof(FILE_RENAME_INFO) + (path.size() * sizeof(wchar_t)) };
auto renameBuffer{ std::make_unique<std::byte[]>(renameBufferSize) };
auto renameInfo{ reinterpret_cast<FILE_RENAME_INFO*>(renameBuffer.get()) };
renameInfo->Flags = FILE_RENAME_FLAG_REPLACE_IF_EXISTS | FILE_RENAME_FLAG_POSIX_SEMANTICS;
renameInfo->RootDirectory = nullptr;
renameInfo->FileNameLength = gsl::narrow_cast<DWORD>(path.size());
std::copy(path.cbegin(), path.cend(), std::begin(renameInfo->FileName));

THROW_IF_WIN32_BOOL_FALSE(SetFileInformationByHandle(hLegacyFile.get(),
                          FileRenameInfo,
                          renameBuffer.get(),
                          gsl::narrow_cast<DWORD>(renameBufferSize)));
```

(end snip)

### Stop resurrecting dead roaming profiles
2020-04-01 19:09:42 +00:00

3 KiB

Adding profiles for third-party tools

This doc will hopefully provide a useful guide for adding profiles for common third-party tools to your settings.json file.

All of these profiles are provided without their guid set. If you'd like to set any of these profiles as your default profile, you'll need to make sure to generate a unique guid for them manually.

Anaconda

Assuming that you've installed Anaconda into %USERPROFILE%\Anaconda3:

{
    "commandline" : "cmd.exe /k \"%USERPROFILE%\\Anaconda3\\Scripts\\activate.bat %USERPROFILE%\\Anaconda3\"",
    "icon" : "%USERPROFILE%/Anaconda3/Menu/anaconda-navigator.ico",
    "name" : "Anaconda3",
    "startingDirectory" : "%USERPROFILE%"
}

cmder

Assuming that you've installed cmder into %CMDER_ROOT%:

{
    "commandline" : "cmd.exe /k \"%CMDER_ROOT%\\vendor\\init.bat\"",
    "name" : "cmder",
    "icon" : "%CMDER_ROOT%/icons/cmder.ico",
    "startingDirectory" : "%USERPROFILE%"
}

Cygwin

Assuming that you've installed Cygwin into C:/Cygwin:

{
    "name" : "Cygwin",
    "commandline" : "C:/Cygwin/bin/bash --login -i",
    "icon" : "C:/Cygwin/Cygwin.ico",
    "startingDirectory" : "C:/Cygwin/bin"
}

Note that the starting directory of Cygwin is set as it is to make the path work. The default directory opened when starting Cygwin will be $HOME because of the --login flag.

Far Manager

Assuming that you've installed Far into c:\Program Files\Far Manager:

{
    "name" : "Far",
    "commandline" : "\"c:\\program files\\far manager\\far.exe\"",
    "startingDirectory" : "%USERPROFILE%",
    "useAcrylic" : false
},

Git Bash

Assuming that you've installed Git Bash into C:/Program Files/Git:

{
    "name" : "Git Bash",
    "commandline" : "C:/Program Files/Git/bin/bash.exe -li",
    "icon" : "C:/Program Files/Git/mingw64/share/git/git-for-windows.ico",
    "startingDirectory" : "%USERPROFILE%"
}

Git Bash (WOW64)

Assuming that you've installed Git Bash into C:/Program Files (x86)/Git:

{
    "name" : "Git Bash",
    "commandline" : "%ProgramFiles(x86)%/Git/bin/bash.exe -li",
    "icon" : "%ProgramFiles(x86)%/Git/mingw32/share/git/git-for-windows.ico",
    "startingDirectory" : "%USERPROFILE%"
}

MSYS2

Assuming that you've installed MSYS2 into C:/msys64:

{
    "name" : "MSYS2",
    "commandline" : "C:/msys64/msys2_shell.cmd -defterm -no-start -mingw64",
    "icon": "C:/msys64/msys2.ico",
    "startingDirectory" : "C:/msys64/home/user"
}

Developer Command Prompt for Visual Studio

Assuming that you've installed VS 2019 Professional:

{
    "name" : "Developer Command Prompt for VS 2019",
    "commandline" : "cmd.exe /k \"C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/Common7/Tools/VsDevCmd.bat\"",
    "startingDirectory" : "%USERPROFILE%"
}