microsoft / microsoft/terminal

DOSKEY aliases work unexpectedly

Open
#16,203 10 comments 0 reactions 0 assignees View on GitHub
Area-CookedRead Impact-Visual Issue-Bug Needs-Tag-Fix Priority-3 Product-Conhost
Dominant language
C++
Stars
105k
Forks
9.6k
Avg merge
3d 17h
Merged PRs (30d)
29

Description

### Windows Terminal version

current main

### Windows build number

10.0.19045.3448

### Other Software

_No response_

### Steps to reproduce

According to https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/doskey

> $T or $t Separates commands. Use either of these special characters to separate commands when you create macros or type commands on the doskey command line. These special characters are equivalent to using the ampersand (&) on a command line.

and https://ss64.com/nt/doskey.html

> Advanced macro definitions:
>
> $T If you put more than one command in a DOSKEY macro, use $T.
> to separate them. Equivalent to & in a batch file.

the following commands

```
doskey test=echo 123 $t echo 456
test
```

and

```
echo 123 & echo 456
```
should give the same output.

### Expected Behavior

```
C:\Users\sdn>doskey test=echo 123 $t echo 456

C:\Users\sdn>test
123
456

C:\Users\sdn>
```

### Actual Behavior

```
C:\Users\sdn>doskey test=echo 123 $t echo 456

C:\Users\sdn>test
123

C:\Users\sdn>456

C:\Users\sdn>
```

Related to #14991

Contributor guide

Open the contributing guide

Research direction

Reproduce the DOSKEY macro and direct `echo 123 & echo 456` commands from the issue on the reported Windows build, then compare their output. Start by locating the command and alias parsing entry points related to DOSKEY and review related issue #14991; done means `$t` separates both commands so the alias produces the same output as the direct command.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, shell
Domain
cli, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.