Skip to content

Commit

Permalink
Review troubleshooting page
Browse files Browse the repository at this point in the history
  • Loading branch information
cinnamon-msft committed May 4, 2020
1 parent 08be90f commit da815cc
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 12 deletions.
2 changes: 1 addition & 1 deletion TerminalDocs/new-terminal-arguments.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ms.date: 05/19/2020
ms.topic: overview
---

When opening a new pane or tab with a key binding, you can specify which profile is used by including the profile's name, guid, or index. If none are specified, the default profile is used. This can be done by adding `profile` or `index` to a `splitPane` or `newTab` key binding.
When opening a new pane or tab with a key binding, you can specify which profile is used by including the profile's name, guid, or index. If none are specified, the default profile is used. This can be done by adding `profile` or `index` as an argument to a `splitPane` or `newTab` key binding. Note that indexing starts at 0.

```json
{ "command": { "action": "splitPane", "split": "vertical", "profile": "profile1" }, "keys": "ctrl+a" },
Expand Down
43 changes: 32 additions & 11 deletions TerminalDocs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,33 @@ ms.service: terminal

Here are some common errors/obstacles you may encounter when using Windows Terminal.

## How do I launch WSL in the `~` directory?

By default, the `startingDirectory` of a profile is `%USERPROFILE%` (`C:\Users\<YourUsername>`). This is a Windows path. However, for WSL, you might want to use the WSL home path instead. `startingDirectory` only accepts a Windows-style path, so setting it to start within the WSL distribution can be a little tricky.

Fortunately, with Windows 1903, the file systems of WSL distros can easily be addressed using the `\\wsl$\` prefix. For any WSL distro whose name is `DistroName`, you can use `\\wsl$\DistroName` as a Windows path that points to the root of that distro's file system.

For example, the following works as a profile to launch the "Ubuntu-18.04" distro in its home path:

```json
{
"name": "Ubuntu-18.04",
"commandline" : "wsl -d Ubuntu-18.04",
"startingDirectory" : "//wsl$/Ubuntu-18.04/home/<Your Ubuntu Username>",
}
```

## How do I set my tab title?

If you'd like to have the shell automatically set your tab title, [visit the set the tab title tutorial](./tutorials/tab-title.md). If you want to set your tab title in your settings file, use the following steps:
If you'd like to have the shell automatically set your tab title, [visit the tab title tutorial](./tutorials/tab-title.md). If you want to set your tab title in your settings file, use the following steps:

1. Add `"suppressApplicationTitle": true` to the profile you want to suppress any title change events that get sent from the shell. Having only this setting added to your profile will set your tab title to the name of your profile.

2. If you want a custom tab title that is not the name of your profile, you can add `"tabTitle": "TITLE"` where TITLE is replaced with your preferred tab title.

## Command line arguments in PowerShell

Powershell uses a semicolon `;` to delimit statements. To interpret a semicolon `;` as a command delimiter for `wt` command line arguments, you need to escape semicolon characters using backticks `` ` ``. Powershell also has the stop parsing operator (`--%`), which instructs it to stop interpreting anything after it and just pass it on verbatim.

| Powershell Command | Description |
|--|--|
| `wt foo ; bar` | Open a tab running the command `foo1`. In original powershell instance, run `bar`. |
| ``wt foo `; bar`` | Open a total of 2 tabs. Each running the following command...<ul> <li>`foo` </li> <li>`bar`</li> </ul> |
| `wt --% foo ; bar ; baz` | Open a total of 3 tabs. Each running the following command...<ul> <li>`foo`</li> <li>`bar`</li> <li>`baz`</li> </ul> |
PowerShell uses a semicolon `;` to delimit statements. To interpret a semicolon `;` as a command delimiter for `wt` command line arguments, you need to escape semicolon characters using backticks `` ` ``. PowerShell also has the stop parsing operator (`--%`), which instructs it to stop interpreting anything after it and just pass it on verbatim. For more information on command line arguments, visit the [Command line arguments page](./command-line-arguments.md).

## Command line arguments in WSL

Expand All @@ -42,10 +52,21 @@ The `/c` option makes CMD run the command, then terminate.

## My profile's `startingDirectory` setting is being ignored

First, check to make sure your settings.json's syntax is correct. We automatically inject `"$schema": "https://aka.ms/terminal-profiles-schema"` at the top of your settings.json to help with that. Some apps, like Visual Studio Code, use the attached schema to validate your json as you make edits.
First, check to make sure your settings.json's syntax is correct. We automatically inject `"$schema": "https://aka.ms/terminal-profiles-schema"` at the top of your settings.json to help with that. Some applications, like Visual Studio Code, use the attached schema to validate your json as you make edits.

If your settings are correct, it may be that you are running a startup script that sets the starting directory of your terminal separately. For example, PowerShell has its own separate concept of profiles. If you are changing your starting directory there, that takes precedence over the one defined in Windows Terminal.
If your settings are correct, it may be that you are running a startup script that sets the starting directory of your Terminal separately. For example, PowerShell has its own separate concept of profiles. If you are changing your starting directory there, it will take precedence over the one defined in Windows Terminal.

Alternatively, if you are running a script using the `commandline` profile setting, it may be that you are setting the location there. Similar to PowerShell profiles, your commands there take precedence over the `startingDirectory` profile setting.

In the end, `startingDirectory` launches a new terminal instance in the given directory. If the terminal runs any code that changes its directory, that may be a good place to take a look.
In the end, `startingDirectory` launches a new Terminal instance in the given directory. If the Terminal runs any code that changes its directory, that may be a good place to take a look.

## `Ctrl+=` does not increase the font size

If you are using a German keyboard layout, you may run into this problem. `ctrl+=` gets deserialized as `ctrl+shift+0` if your main keyboard layout is set to German. This is the correct mapping for German keyboards.

More importantly, the app never receives the `ctrl+shift+0` keystroke, however. This is because `ctrl+shift+0` is reserved by Windows if you have multiple keyboard layouts active.

If you would like to disable this feature to get it to work properly, follow the instructions for "Change Hotkeys to Switch Keyboard Layout in Windows 10" in this [blog post](https://winaero.com/blog/change-hotkeys-switch-keyboard-layout-windows-10/).
Change the 'Switch Keyboard Layout' option to 'Not Assigned' (or off of `ctrl+shift`), then click OK and then Apply. `ctrl+shift+0` should now work as a key binding and is passed through to the Terminal.

On the other hand, if you do use this hotkey feature for multiple input languages, you can configure your own custom key binding in your settings.json file.

0 comments on commit da815cc

Please sign in to comment.