Command Substitution is Sorely Needed #12616

Closed
opened 2026-01-31 03:20:23 +00:00 by claunia · 1 comment
Owner

Originally created by @zQueal on GitHub (Feb 16, 2021).

Description of the new feature/enhancement

Microsoft Terminal deserves command substitution. It's a sorely missed feature on the Windows platform. To the best of my knowledge there's simply no way to do it on Windows at all, let alone in a sane way. I tried searching tickets here and saw no other calls for this feature, so I wanted to open a feature request.

Proposed technical implementation details (optional)

As a simple example, I wanted to delete any text file in the current directory which contained config and was a text file. Using fd I can find them all by executing;

fd config -t file -e txt

But as far as I understand it there's no way to use command substitution to remove these files in a single command as you would do on any other modern platform;

rm $(fd config -t file -e txt)

Transactional commands feel really old and if you're frank with yourself, just a plain bad way to do things most of the time.

Originally created by @zQueal on GitHub (Feb 16, 2021). # Description of the new feature/enhancement Microsoft Terminal deserves command substitution. It's a sorely missed feature on the Windows platform. To the best of my knowledge there's simply no way to do it on Windows at all, let alone in a sane way. I tried searching tickets here and saw no other calls for this feature, so I wanted to open a feature request. # Proposed technical implementation details (optional) As a simple example, I wanted to delete any text file in the current directory which contained `config` and was a text file. Using [`fd`](https://github.com/sharkdp/fd) I can find them all by executing; fd config -t file -e txt But as far as I understand it there's no way to use command substitution to remove these files in a single command as you would do on any other modern platform; rm $(fd config -t file -e txt) Transactional commands feel really old and if you're frank with yourself, just a plain bad way to do things most of the time.
claunia added the Issue-FeatureNeeds-TriageNeeds-Tag-FixResolution-Won't-Fix labels 2026-01-31 03:20:23 +00:00
Author
Owner

@DHowett commented on GitHub (Feb 16, 2021):

Thanks for the request! This is a shell feature—something that is going to be supported by the application you’re talking to through Windows Terminal.

PowerShell, which comes with Windows, already supports command substitution (and much more). It would be worth a look.

We won’t be adding it to the “Command Prompt”. CMD is supposed to remain as compatible and as small as possible, and every change we make has a huge risk associated with it.

Gonna close this one out since there’s nothing Terminal can do here. Sorry!

@DHowett commented on GitHub (Feb 16, 2021): Thanks for the request! This is a shell feature—something that is going to be supported by the application you’re talking to _through_ Windows Terminal. PowerShell, which comes with Windows, already supports command substitution (and much more). It would be worth a look. We won’t be adding it to the “Command Prompt”. CMD is supposed to remain as compatible and as small as possible, and every change we make has a huge risk associated with it. Gonna close this one out since there’s nothing Terminal can do here. Sorry!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#12616