microsoft / microsoft/terminal

wt split-pane -D overwrites command line command with profile command

Open
#17,481 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-Commandline Issue-Bug Product-Terminal
Dominant language
C++
Stars
105k
Forks
9.6k
Avg merge
3d 17h
Merged PRs (30d)
29

Description

### Windows Terminal version

1.20.11381.0

### Windows build number

10.0.19045.0

### Other Software

_No response_

### Steps to reproduce

Hello,

I made a function that is called to open 6 panes under Windows Terminal and which will connect automatically to several hosts.
I've done it thiw way because I was not able to find on the documentation a cleaner way.

This script is working but I've found that the command split-pane :
* With the parameter -H the following command is executed
* With the parameter -D the following command **isn't** executed

**Working** 👍
```
wt.exe --maximized -p NoProfile pwsh -wd ~ -nop -noexit -command "connect $($Hosts[0])" ; split-pane -s .33 pwsh -nop -noexit -command "connect $($Hosts[2])" -D
wt.exe --maximized -p NoProfile pwsh -wd ~ -nop -noexit -command "connect $($Hosts[0])" ; split-pane -s .33 -H pwsh -nop -noexit -command "connect $($Hosts[2])
```

**Not working** 👎
```
wt.exe --maximized -p NoProfile pwsh -wd ~ -nop -noexit -command "connect $($Hosts[0])" ; split-pane -s .33 -D pwsh -nop -noexit -command "connect $($Hosts[2])
```

My workaround like posted here is to move the parameter -D at the end of the command, this way it works.

```
if ($null -ne $Hosts) {
# Open 6 panes with 6 servers
wt.exe --maximized -p NoProfile pwsh -wd ~ -nop -noexit -command "connect $($Hosts[0])" `; `
split-pane -s .33 pwsh -nop -noexit -command "connect $($Hosts[2])" -D `; move-focus first `; split-pane -s .5 pwsh -wd ~ -nop -noexit -command "connect $($Hosts[1])" -D `; `
split-pane -s .5 -H pwsh -wd ~ -nop -noexit -command "connect $($Hosts[4])" `; move-focus left `; split-pane -s .5 -H pwsh -wd ~ -nop -noexit -command "connect $($Hosts[3])" `; move-focus right `; move-focus right `; split-pane --tabColor `#f59218 --title 'DBAPatching' -s .5 -H pwsh -wd ~ -nop -noexit -command "connect $($Hosts[5])"
}
```

### Expected Behavior

I would like to be able to use the same positional argument -D or -H on the same spot or at least have indication on the reference doc about this.

### Actual Behavior

When using -H then command -> command executed
When using -D then command -> command not executed

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported commands through the wt.exe entry point, comparing split-pane with -H and -D in the same position. Trace how each option is parsed and verify that the command after -D is executed consistently, or that the reference documentation clearly describes the positional behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.