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

Add support for wt.exe to run commands in the current Terminal Window #4656

Closed
plusls opened this issue Feb 20, 2020 · 9 comments
Closed

Add support for wt.exe to run commands in the current Terminal Window #4656

plusls opened this issue Feb 20, 2020 · 9 comments
Labels
Area-Commandline wt.exe's commandline arguments Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Product-Terminal The new Windows Terminal. Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.

Comments

@plusls
Copy link

plusls commented Feb 20, 2020

Description of the new feature/enhancement

I found that wt.exe can open a new window and split it, can it split current window like tmux split-window -v, tmux split-window -h?
like this:
image

Proposed technical implementation details (optional)

@plusls plusls added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Feb 20, 2020
@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Feb 20, 2020
@zadjii-msft
Copy link
Member

Yep, it absolutely can! See this doc for more details.

Consider the following commandline:
```powershell
wt ; split-pane -p "Windows PowerShell" ; split-pane -H wsl.exe
```
This creates a new Windows Terminal window with one tab, and 3 panes:
* `wt`: Creates the new tab with the default profile
* `split-pane -p "Windows PowerShell"`: This will create a new pane, split from
the parent with the default profile. This pane will open with the "Windows
PowerShell" profile
* `split-pane -H wsl.exe`: This will create a third pane, slit _horizontally_
from the "Windows PowerShell" pane. It will be running the default profile,
and will use `wsl.exe` as the commandline (instead of the default profile's
`commandline`).

Consider the following commandline:

wt ; split-pane -p "Windows PowerShell" ; split-pane -H wsl.exe 

This creates a new Windows Terminal window with one tab, and 3 panes:

  • wt: Creates the new tab with the default profile
  • split-pane -p "Windows PowerShell": This will create a new pane, split from the parent with the default profile. This pane will open with the "Windows PowerShell" profile
  • split-pane -H wsl.exe: This will create a third pane, slit horizontally from the "Windows PowerShell" pane. It will be running the default profile, and will use wsl.exe as the commandline (instead of the default profile's commandline).

@zadjii-msft zadjii-msft added Issue-Question For questions or discussion Resolution-Answered Related to questions that have been answered Area-Commandline wt.exe's commandline arguments and removed Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. labels Feb 20, 2020
@plusls
Copy link
Author

plusls commented Feb 20, 2020

but i want split current window

@plusls
Copy link
Author

plusls commented Feb 20, 2020

wt ; split-pane -p "Windows PowerShell" ; split-pane -H wsl.exe 

it will open a new terminal...

@zadjii-msft
Copy link
Member

Sure yea you can do that in the current window. Use the splitPane keybindings. By default, these are bound to the following keys:

{ "command": { "action": "splitPane", "split": "horizontal"}, "keys": [ "alt+shift+-" ] },
{ "command": { "action": "splitPane", "split": "vertical"}, "keys": [ "alt+shift+plus" ] },

@plusls
Copy link
Author

plusls commented Feb 20, 2020

but I want use a shell command to do it, I want to write it in my script.

@zadjii-msft
Copy link
Member

Unfortunately, that's not supported quite yet. It's mentioned in the "future considerations" part of the original spec. It's sort-of tracked as a sub-point in #4632, but there's not a dedicated thread for it yet.

Congratulations, this is now the thread

@zadjii-msft zadjii-msft changed the title wt.exe Split current window Add support for wt.exe to run commands in the current Terminal Window Feb 20, 2020
@zadjii-msft zadjii-msft reopened this Feb 20, 2020
@zadjii-msft zadjii-msft added Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Product-Terminal The new Windows Terminal. and removed Issue-Question For questions or discussion Resolution-Answered Related to questions that have been answered labels Feb 20, 2020
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Feb 20, 2020
@zadjii-msft zadjii-msft added this to Spec Needed ❓ in Specification Tracker via automation Feb 20, 2020
@zadjii-msft zadjii-msft added this to the Terminal Backlog milestone Feb 20, 2020
@DHowett-MSFT
Copy link
Contributor

We actually do have a thread for it, /dup #4472!

@ghost
Copy link

ghost commented Feb 20, 2020

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@ghost ghost closed this as completed Feb 20, 2020
@ghost ghost added Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing. and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Feb 20, 2020
@zadjii-msft zadjii-msft removed this from Spec Needed ❓ in Specification Tracker Feb 20, 2020
@zadjii-msft zadjii-msft removed this from the Terminal Backlog milestone Feb 20, 2020
@lewis-munyi
Copy link

lewis-munyi commented Jun 4, 2020

Description of the new feature/enhancement

I found that wt.exe can open a new window and split it, can it split current window like tmux split-window -v, tmux split-window -h?
like this:
image

Proposed technical implementation details (optional)

@plusls I use this workaround.

Create a function in my default profile that opens the new tab with split windows and exits the previous tab.

# %USERPROFILE%\OneDrive\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
Function split{
    # Open window with split panes
    start-process wt ' -p "Windows Powershell" ; split-pane -p "Windows Powershell" ; split-pane -H -p "Ubuntu"';
    # Exit
    echo "Exiting...!";
    Exit(0);
}

Then call the function from the terminal when needed.

> split

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Commandline wt.exe's commandline arguments Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Product-Terminal The new Windows Terminal. Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.
Projects
None yet
Development

No branches or pull requests

4 participants