[PR #6576] wt.exe: Add support for "short" sub-commands #26752

Open
opened 2026-01-31 09:17:55 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/6576

State: closed
Merged: Yes


This adds nt, sp, and ft as aliases for new-tab, split-pane,
and focus-tab, respectively. These do exactly the same thing as their
long for counterparts, but are just shorter, for those of us who type
slower than a fifth grader 👀

Now you can do

wt nt cmd.exe /k #work 15 ; sp cmd.exe /k #work 15 ; sp cmd.exe /k
media-commandline ; nt powershell dev\\symbols.ps1 ; nt -p \"Ubuntu\" ;
nt -p \"Ubuntu\" ; ft -t 0

instead of

new-tab cmd.exe /k #work 15 ; split-pane cmd.exe /k #work 15 ;
split-pane cmd.exe /k media-commandline ; new-tab powershell
dev\\symbols.ps1 ; new-tab -p \"Ubuntu\" ; new-tab -p \"Ubuntu\" ;
focus-tab -t 0

The pattern I'm using here is that each of these subcommands now has a
little helper lambda that actually sets up the subcommand with the
required arguments, and we just call that lambda twice, once for the
long-form of the command, and again for the short.

I imagine that in the future, we won't necessarily have short-forms for
every subcommands, so if there are future conflicts we'd have to figure
that out pre-emptively, but these all seem like they'll need a short
form.

Closes #5466

**Original Pull Request:** https://github.com/microsoft/terminal/pull/6576 **State:** closed **Merged:** Yes --- This adds `nt`, `sp`, and `ft` as aliases for `new-tab`, `split-pane`, and `focus-tab`, respectively. These do exactly the same thing as their long for counterparts, but are just shorter, for those of us who type slower than a fifth grader 👀 Now you can do ``` wt nt cmd.exe /k #work 15 ; sp cmd.exe /k #work 15 ; sp cmd.exe /k media-commandline ; nt powershell dev\\symbols.ps1 ; nt -p \"Ubuntu\" ; nt -p \"Ubuntu\" ; ft -t 0 ``` instead of ``` new-tab cmd.exe /k #work 15 ; split-pane cmd.exe /k #work 15 ; split-pane cmd.exe /k media-commandline ; new-tab powershell dev\\symbols.ps1 ; new-tab -p \"Ubuntu\" ; new-tab -p \"Ubuntu\" ; focus-tab -t 0 ``` The pattern I'm using here is that each of these subcommands now has a little helper lambda that actually sets up the subcommand with the required arguments, and we just call that lambda twice, once for the long-form of the command, and again for the short. I imagine that in the future, we won't necessarily have short-forms for every subcommands, so if there are future conflicts we'd have to figure that out pre-emptively, but these all seem like they'll need a short form. Closes #5466
claunia added the pull-request label 2026-01-31 09:17:55 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#26752