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

Argument doesn't work depending on their position #17481

Open
arnaudcharles opened this issue Jun 28, 2024 · 0 comments
Open

Argument doesn't work depending on their position #17481

arnaudcharles opened this issue Jun 28, 2024 · 0 comments
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting

Comments

@arnaudcharles
Copy link

arnaudcharles commented Jun 28, 2024

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

@arnaudcharles arnaudcharles added Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting
Projects
None yet
Development

No branches or pull requests

1 participant