Skip to content

Commit

Permalink
Main > Live sync (#565)
Browse files Browse the repository at this point in the history
* Update dynamic-profiles.md (#438)

* Update dynamic-profiles.md

Create section for dynamic profile for `Developer Powershell for VS 2019`

* Update dynamic-profiles.md

Update name and remove `startingDirectory`

* Update dynamic-profiles.md

Explain a little better

* Update VS version info in 3rd party (#462)

* Update custom prompt tutorial w latest OMP steps (#467)

* Add themes link

* Bulk fix - Removing .localizationpriority (#469)

* Testing image (#474)

* Update new-tab-same-directory.md

* Update new-tab-same-directory.md

* Include note on how to save the directory of a pane (#473)

* Add decimal value note for pane size

Resolves #276

* Remove VS PowerShell and CMD for 3rd party 

..these are now officially dynamic profiles.. so no longer need to be added as 3rd party as of Terminal v. 1.12. :)

* Add faq for psreadline

* Fix formatting

* Remove space before code block

* Remove code block

* Fix link

* startingDirectory path for WSL no longer requires prefix

* Update custom-prompt-setup.md (#482)

* style: fix typo in new-tab-same-directory.md (#486)

"it's" should be "its" because it wouldn't make sense otherwise.

* Updated based on pull 9270 in Terminal repo

* GUID generation for dynamic fragments (#320) (#460)

Add information on GUID generation based on microsoft/terminal#10374
and improve wording to make the importance of a profile GUID clearer.

* FIx to close #484

* Typo

Resolves #483

* Add UTF8 note

Resolves #339

* Fix note formatting

* Merge release-1.13 into main (#492)

Co-authored-by: Matt Wojciakowski <mattwoj@microsoft.com>
Co-authored-by: Mike Griese <migrie@microsoft.com>

* Minor intro rewrite (#487)

* typo fix

* Remove start from PowerShell commands

* winget link fix

* Link fix

* link fix

* link fix

* Add `bellsound` profile setting (#508)

* Fix typos found by codespell (#501)

* Change step to view themes on documentation site (#505)

* Set ms.topic: faq where YamlMime:FAQ (#506)

* Fix pkgmgr link

* troubleshooting: clarify WSL `startingDirectory` entry (#516)

* troubleshooting: Linux paths support in 'startingDirectory' was added in 1.11.2921.0

In 7cd48bc (startingDirectory path for WSL no longer requires prefix,
2022-01-07), the "Set your WSL distribution to start in the home
directory" section of the troubleshooting guide was updated to mention
that WSL paths can now be directly referenced, following
microsoft/terminal@a2a6050 (When launching wsl, promote the starting
directory to --cd (#9223), 2021-08-02).

The text mentions this feature was added in Windows Terminal
1.12.3472.0, but it actually dates back to v1.11.2421.0 (Preview) and
v1.11.2921.0 (Stable).

Update the text to mention the stable version, and link to this version
in the GitHub releases. Also slightly improve the wording (s/are now/can
now be/).

* troubleshooting: remove confusing 'Important' note about WSL 'startingDirectory'

In e7f739e (Docs updates for 1.11 release (#397), 2021-08-31), an
"Important" note was added to the "Set your WSL distribution to start in
the home directory" section of the troubleshooting page to mention that
'startingDirectory' now accepts Linux-style paths, following
microsoft/terminal@a2a6050 (When launching wsl, promote the starting
directory to --cd (#9223), 2021-08-02).

The note mentions that Linux-styled paths were accepted "on newer
versions of Windows", presumably meaning newer than 1903. Indeed, that
version was at the time mentioned in the text as the first Windows
vesion supporting the '//wsl$/' P9 prefix (it had been mentioned since
the WSL startingDirectory troubleshooting entry was created in da815cc
(Review troubleshooting page, 2020-05-04).

The text of the section was updated in 7cd48bc (startingDirectory path
for WSL no longer requires prefix, 2022-01-07) to add an example with a
Linux-style path, and to mention that this feature was added in Windows
Terminal itself (not in Windows), thus removing the mention of Windows
1903. However, the "Important" note was left, and it still confusingly
mentions that Linux-style paths are accepted on "newer" versions of
Windows, without mentioning newer than what.

Remove the note altogether.

* .gitattributes: mark '*.md' as Markdown files

Denote Markdown files as such with the 'diff' Git attribute [1]. This
allows various Git commands (diff [2, 3], grep [4, 5], log [6], blame
[7]) to show in which part of the "code" the changes are located in the
hunk header, i.e. the previous commit would be shown as

    diff --git a/TerminalDocs/troubleshooting.md
    b/TerminalDocs/troubleshooting.md
    index 4a880fa..2c9d14d 100644
    --- a/TerminalDocs/troubleshooting.md
    +++ b/TerminalDocs/troubleshooting.md
    @@ -40,8 +40,6 @@ ## Set your WSL distribution to start in the home `~` directory when launched
     }
     ```

    -> [!IMPORTANT]
    -> On newer versions of Windows, `startingDirectory` can accept Linux-style paths.

     ## Setting the tab title

Notice how the hunk header indicates the changes are in the "Set your
WSL distribution to start in the home" section.

The history of that specific entry can now be interrogated using

    git log -L:"Set your WSL distribution":TerminalDocs/troubleshooting.md

[1] https://git-scm.com/docs/gitattributes#_defining_a_custom_hunk_header
[2] https://git-scm.com/docs/git-diff#_generating_patch_text_with_p
[3] https://git-scm.com/docs/git-diff#Documentation/git-diff.txt--W
[4] https://git-scm.com/docs/git-grep#Documentation/git-grep.txt--p
[5] https://git-scm.com/docs/git-grep#Documentation/git-grep.txt--W
[6] https://git-scm.com/docs/git-log#Documentation/git-log.txt--Lltfuncnamegtltfilegt
[7] https://git-scm.com/docs/git-blame#Documentation/git-blame.txt--Lltfuncnamegt

* Remove version specifics relating to WSL paths

* New tab same directory (zsh) (#513)

* Add acrylic issues to troubleshooting (#518)

* Add acrylic issues to troubleshooting doc

* Add autohide cursor setting

* Add windows settings differentiator

* command-palette: simplify example for iterable commands (#511)

* Move iterable commands gif lower down

* Quoted the env-var for `setx PROMPT` (#502)

* Updated --title documentation to specify behavior for panes (#500)

* push (#520)

* json-fragment-extensions: output GUIDs in "registry format" (#515)

* fix(powerline): adjust docs to reflect oh-my-posh changes (#534)

* Merge release-1.14 into main (#544)

Co-authored-by: Kayla Cinnamon <cinnamon@microsoft.com>
Co-authored-by: Carlos Zamora <carlos.zamora@microsoft.com>

* Fix link

* Add package id command for winget (#548)

* clarify (#551)

* Merge release-1.15 into main (#554)

* Document keyboard selection (#552)

* minor tweaks

* Document scroll marks

* Fix warning

* Remove old preview labels

Co-authored-by: Carlos Zamora <carlos.zamora@microsoft.com>

* Add selection to TOC

* Instructions for MINGW (#525)

* Instructions for MINGW

- Added instructions for MINGW
- Added a link to this file, so it's easier to find it for people who'd like to contribue

* Update TerminalDocs/tutorials/new-tab-same-directory.md

Co-authored-by: Philippe Blain <levraiphilippeblain@gmail.com>

Co-authored-by: Philippe Blain <levraiphilippeblain@gmail.com>

* Add missing [Shift] in key binding (#557)

* Fix PowerShell commands

Based on #527

* Add Starship example (#530)

Co-authored-by: Matt Wojciakowski <mattwoj@microsoft.com>

* Add Fish shell

Resolves #523

* Move Mingw under WSL section

* Add focus mode tip

Resolves #528

* Change bashrc config to bash_profile

Recommended in #556 so that the `PROMPT_COMMAND` variable isn't repeatedly appended on the start of every bash process.

Resolves #556

* [BULK UPDATE] DocuTune - Fix build validation issues: docs-link-absolute (#553)

* Update interaction.md (#562)

You left click to block select

Co-authored-by: Shubham Gogna <36936863+shgogna@users.noreply.github.com>
Co-authored-by: Alma Jenks <v-alje@microsoft.com>
Co-authored-by: Jason Howell <5067358+JasonWHowell@users.noreply.github.com>
Co-authored-by: Schuyler Rosefield <Rosefield@users.noreply.github.com>
Co-authored-by: Sanam <31341013+sanamhub@users.noreply.github.com>
Co-authored-by: Haltarys <45515869+Haltarys@users.noreply.github.com>
Co-authored-by: Nikolas Grottendieck <git@nikolasgrottendieck.com>
Co-authored-by: Kayla Cinnamon <cinnamon@microsoft.com>
Co-authored-by: Mike Griese <migrie@microsoft.com>
Co-authored-by: Dimitri Papadopoulos Orfanos <3234522+DimitriPapadopoulos@users.noreply.github.com>
Co-authored-by: Shawn Melton <11204251+wsmelton@users.noreply.github.com>
Co-authored-by: Alex Buck <abuck@microsoft.com>
Co-authored-by: Philippe Blain <levraiphilippeblain@gmail.com>
Co-authored-by: Adrien Clairembault <42734840+AdrienClairembault@users.noreply.github.com>
Co-authored-by: Paul "TBBle" Hampson <Paul.Hampson@Pobox.com>
Co-authored-by: Joshua Cook <me@joshuacook.dev>
Co-authored-by: Aaron Junker <aaron.junker@outlook.com>
Co-authored-by: Jan De Dobbeleer <2492783+JanDeDobbeleer@users.noreply.github.com>
Co-authored-by: Carlos Zamora <carlos.zamora@microsoft.com>
Co-authored-by: Alexey Grigorev <alexeygrigorev@users.noreply.github.com>
Co-authored-by: Tobi <22715034+twobiers@users.noreply.github.com>
Co-authored-by: Hans Kilian <hkkilian@gmail.com>
  • Loading branch information
1 parent a8539cf commit 79b79bd
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 16 deletions.
10 changes: 5 additions & 5 deletions .openpublishing.redirection.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@
"redirections": [
{
"source_path": "TerminalDocs/customize-settings/key-bindings.md",
"redirect_url": "https://docs.microsoft.com/windows/terminal/customize-settings/actions",
"redirect_url": "/windows/terminal/customize-settings/actions",
"redirect_document_id": true
},
{
"source_path": "TerminalDocs/customize-settings/global-settings.md",
"redirect_url": "https://docs.microsoft.com/windows/terminal/customize-settings/startup",
"redirect_url": "/windows/terminal/customize-settings/startup",
"redirect_document_id": true
},
{
"source_path": "TerminalDocs/customize-settings/profile-settings.md",
"redirect_url": "https://docs.microsoft.com/windows/terminal/customize-settings/profile-general",
"redirect_url": "/windows/terminal/customize-settings/profile-general",
"redirect_document_id": true
},
{
"source_path": "TerminalDocs/get-started.md",
"redirect_url": "https://docs.microsoft.com/windows/terminal/install",
"redirect_url": "/windows/terminal/install",
"redirect_document_id": true
},
{
"source_path": "TerminalDocs/tutorials/powerline-setup.md",
"redirect_url": "https://docs.microsoft.com/windows/terminal/tutorials/custom-prompt-setup",
"redirect_url": "/windows/terminal/tutorials/custom-prompt-setup",
"redirect_document_id": true
}
]
Expand Down
4 changes: 2 additions & 2 deletions TerminalDocs/command-line-arguments.md
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ wt --tabColor #009999 ; new-tab --tabColor #f59218
#### [PowerShell](#tab/powershell)

```powershell
wt --tabColor #009999 ; new-tab --tabColor #f59218
wt --tabColor '#009999' `; new-tab --tabColor '#f59218'
```

#### [Linux](#tab/linux)
Expand All @@ -448,7 +448,7 @@ Execution aliases do not work in WSL distributions. If you want to use wt.exe fr
When `--tabColor` is set for a tab, it is associated with the first pane of this tab. Hence in a tab with multiple panes, the color will be applied only if the first pane is in focus. To set the tab color for additional panes, you will need to add the `--tabColor` parameter to the `split-pane` subcommand as well. In the example below, a tab with two panes is created with tab colors specified for each pane:

```powershell
wt new-tab --tabColor #009999 ; split-pane --tabColor #f59218
wt new-tab --tabColor '#009999' `; split-pane --tabColor '#f59218'
```

### Color scheme
Expand Down
2 changes: 1 addition & 1 deletion TerminalDocs/customize-settings/interaction.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ ___

## Remove trailing white-space in rectangular selection

When this is set to `true` and you copy text in a rectangular (block) selection to the clipboard, trailing white-spaces are removed from each line. When it's set to `false`, the white-spaces are preserved, ensuring that all lines have the same length. To copy text in a rectangular (block) selection, hold down the <kbd>Alt</kbd> key, right-click, and drag your mouse over the text area you want to select. This can be useful for selecting text columns, etc.
When this is set to `true` and you copy text in a rectangular (block) selection to the clipboard, trailing white-spaces are removed from each line. When it's set to `false`, the white-spaces are preserved, ensuring that all lines have the same length. To copy text in a rectangular (block) selection, hold down the <kbd>Alt</kbd> key, click and drag your mouse over the text area you want to select. This can be useful for selecting text columns, etc.

**Property name:** `trimBlockSelection`

Expand Down
4 changes: 2 additions & 2 deletions TerminalDocs/selection.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ Regardless of being in mark mode, you can expand an existing selection using the
| Key binding | Result |
| ----------- | ------ |
| <kbd>Shift</kbd> + Arrow keys | Expand by character in the specified direction |
| <kbd>Ctrl</kbd> + <kbd>Left</kbd> | Expand to the beginning of the previous or existing word |
| <kbd>Ctrl</kbd> + <kbd>Right</kbd> | Expand to the end of the next or existing word |
| <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Left</kbd> | Expand to the beginning of the previous or existing word |
| <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Right</kbd> | Expand to the end of the next or existing word |
| <kbd>Shift</kbd> + <kbd>Home</kbd> | Expand to the beginning of the line |
| <kbd>Shift</kbd> + <kbd>End</kbd> | Expand to the end of the line |
| <kbd>Shift</kbd> + <kbd>Pgup</kbd> | Expand up by a page (viewport) |
Expand Down
20 changes: 19 additions & 1 deletion TerminalDocs/tips-and-tricks.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Windows Terminal tips and tricks
description: In this page, you will find tips and tricks to help improve your Windows Terminal experience.
author: cinnamon-msft
ms.author: cinnamon
ms.date: 10/08/2021
ms.date: 07/08/2022
ms.topic: how-to
---

Expand Down Expand Up @@ -130,6 +130,24 @@ Navigating to the parent directory with a key binding may also be helpful.

You can also use this functionality to run builds or test scripts.

## Focus mode

"Focus mode" hides the title bar and tabs normally located at the top of Windows Terminal, letting you focus only on the terminal content. It is similar to ["Zen mode"](https://code.visualstudio.com/docs/getstarted/tips-and-tricks#_zen-mode) in Visual Studio Code.

To enter focus mode, open the [command pallette](./command-palette.md) using `Ctrl` + `Shift` + `p`, enter "focus mode", and select "Toggle focus mode." To exit focus mode, repeat these same steps.

To set focus mode to launch every time you start Windows Terminal, open the **Settings** (`Ctrl` + `,`) and select the **Startup** tab. Under **Launch mode**, select **Focus** (or **Maximized focus**, which is focus mode with your terminal window maximized). Select **Save** before exiting. The next time you launch the Windows Terminal, it will open up in focus mode. To stop Windows Terminal from launching in focus mode, follow these same steps, but select **Default** from the list of **Launch mode** options.

To add a shortcut key (or keybinding) for entering focus mode, open the `settings.json` file (`Ctrl` + `Shift` + `,`). Inside your `settings.json` file, find the [`"actions":`](./customize-settings/actions.md) section and add the following command:

```json
{ "command": "toggleFocusMode", "keys": "ctrl+f12" }
```

Replace "ctrl+f12" with the shortcut / keybinding of your choice, but be sure not to repeat any existing keybindings from the Actions list. You can also see a list of Actions with associated keybindings, and **+ Add new** bindings, in the **Actions** tab of the Windows Terminal **Settings** dashboard. Remember to **Save** after making any changes. You can now toggle focus mode using the "action" shortcut key that you created. (In the case of our example, `Shift` + `F12`).

To learn more about this command, see [`toggleFocusMode`](/windows/terminal/customize-settings/actions#toggle-focus-mode).

## Quake mode

"Quake mode" is the name for the special mode the terminal enters when naming a window `_quake`. When a window is in quake mode:
Expand Down
50 changes: 45 additions & 5 deletions TerminalDocs/tutorials/new-tab-same-directory.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ title: Opening a tab/pane in the same directory
description: In this tutorial, you learn how to configure your shell to allow Windows Terminal to open tabs in the same path.
author: zadjii-msft
ms.author: migrie
ms.date: 11/18/2021
ms.date: 07/08/2022
ms.topic: tutorial
#Customer intent: As a developer or IT admin, I want to open tabs in the same working directory as my current tab.
---

# Tutorial: Opening a tab/pane in the same directory in Windows Terminal
# Tutorial: Opening a tab or pane in the same directory in Windows Terminal

Typically, the "new tab" and "split pane" actions will always open a new tab/pane in whatever the `startingDirectory` is for that profile. However, on other platforms, it's common for new tabs to automatically use the working directory of the current tab as the starting directory for a new tab. This allows the user to quickly multitask in a single directory.

Expand Down Expand Up @@ -65,7 +65,7 @@ function prompt {

#### PowerShell with posh-git

If you're using posh-git, then that will already modify your prompt. In that case, you'll want to only add the necessary output to the already modified prompt. The following example is a lightly modified version of this example from [the ConEmu docs](https://conemu.github.io/en/ShellWorkDir.html#PowerShellPoshGit):
If you're using [posh-git](https://github.com/dahlbyk/posh-git), then that will already modify your prompt. In that case, you'll want to only add the necessary output to the already modified prompt. The following example is a lightly modified version of this example from [the ConEmu docs](https://conemu.github.io/en/ShellWorkDir.html#PowerShellPoshGit):

```powershell
function prompt
Expand All @@ -84,11 +84,26 @@ function prompt
}
```

#### PowerShell with Starship

If you're using [Starship](http://starship.rs/), then that will already modify your prompt. In that case, you'll want to only add the necessary output to the already modified prompt.

```powershell
function Invoke-Starship-PreCommand {
$loc = $($executionContext.SessionState.Path.CurrentLocation);
$prompt = "$([char]27)]9;12$([char]7)"
if ($loc.Provider.Name -eq "FileSystem")
{
$prompt += "$([char]27)]9;9;`"$($loc.Path)`"$([char]7)"
}
$host.ui.Write($prompt)
}
### WSL
#### `bash`
Add the following line to the end of your `.bashrc` file:
Add the following line to the end of your `.bash_profile` config file:
```bash
PROMPT_COMMAND=${PROMPT_COMMAND:+"$PROMPT_COMMAND; "}'printf "\e]9;9;%s\e\\" "$(wslpath -w "$PWD")"'
Expand All @@ -109,8 +124,33 @@ precmd_functions+=(keep_current_path)

The `precmd_functions` hook tells zsh what commands to run before displaying the prompt. The `printf` statement is what we're using to append the sequence for setting the working directory with the Terminal. The `$(wslpath -w "$PWD")` bit will invoke the `wslpath` executable to convert the current directory into its Windows-like path. Using `precmd_functions+=` make sure we append the `keep_current_path` function to any existing function already defined for this hook.

#### Fish

If you're using [Fish shell](https://fishshell.com/), add the following lines to the end of your config file located at `~/.config/fish/config.fish`:

```bash
function storePathForWindowsTerminal --on-variable PWD
if test -n "$WT_SESSION"
printf "\e]9;9;%s\e\\" (wslpath -w "$PWD")
end
end
```
This function will be called whenever the current path is changed to confirm the current session is opened by Windows Terminal (verifying $WT_SESSION) and sending Operating System Command (OSC 9;9;), with the Windows equivalent path (`wslpath -w`) of current path.
#### MINGW
For MINGW, Git Bash and Cygwin, you need to modify the `PROMT_COMMAND` for WSL: replace `wslpath` with `cygpath`.
Add the following line to the end of your `.bashrc` file:
```bash
PROMPT_COMMAND=${PROMPT_COMMAND:+"$PROMPT_COMMAND; "}'printf "\e]9;9;%s\e\\" "`cygpath -w $PWD`"'
```
> [!NOTE]
> Don't see your favorite shell here? If you figure it out, feel free to open a PR to contribute a solution for your preferred shell!
> Don't see your favorite shell here? If you figure it out, feel free to [open a PR](https://github.com/MicrosoftDocs/terminal/edit/main/TerminalDocs/tutorials/new-tab-same-directory.md)
> to contribute a solution for your preferred shell!
## Using actions to duplicate the path
Expand Down

0 comments on commit 79b79bd

Please sign in to comment.