Bash fails to pass control characters to cmd.exe #62

Closed
opened 2026-01-30 21:41:03 +00:00 by claunia · 3 comments
Owner

Originally created by @skylize on GitHub (Jan 30, 2018).

Windows build number

10.0.17074.1002

What you're doing and what's happening

In Windows WSL Bash Terminal

  1. Open cmd inside the Bash terminal and type any command.
sky@SkyZen:~$ cmd.exe
Microsoft Windows [Version 10.0.17074.1002]
(c) 2017 Microsoft Corporation. All rights reserved.

C:\WINDOWS\system32>echo hello
echo hello
hello
  1. Press ↑.

What's wrong / what should be happening instead

Actual behavior: A textual representation of the Up Arrow control key gets typed into the input field.

C:\WINDOWS\system32>^[[A

Expected behavior: Pressing ↑ will show the previous command in the input field.

C:\WINDOWS\system32>echo hello
Originally created by @skylize on GitHub (Jan 30, 2018). ### Windows build number 10.0.17074.1002 ### What you're doing and what's happening In Windows WSL Bash Terminal 1. Open `cmd` inside the Bash terminal and type any command. ``` sky@SkyZen:~$ cmd.exe Microsoft Windows [Version 10.0.17074.1002] (c) 2017 Microsoft Corporation. All rights reserved. C:\WINDOWS\system32>echo hello echo hello hello ``` 2. Press <kbd>&uparrow;</kbd>. ### What's wrong / what should be happening instead ***Actual behavior***: A textual representation of the Up Arrow control key gets typed into the input field. ``` C:\WINDOWS\system32>^[[A ``` ***Expected behavior***: Pressing <kbd>&uparrow;</kbd> will show the previous command in the input field. ``` C:\WINDOWS\system32>echo hello ```
claunia added the Product-ConhostProduct-WSL labels 2026-01-30 21:41:03 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Feb 1, 2018):

Yea, interactive interop is pretty wonky in WSL currently. There's a myriad of issues about it filed over at the WSL repo. I'm sure this could be duped to one of those issues.

@benhillis for visibility.

@zadjii-msft commented on GitHub (Feb 1, 2018): Yea, interactive interop is pretty wonky in WSL currently. There's a myriad of issues about it filed over at the [WSL repo](https://github.com/microsoft/WSL). I'm sure this could be duped to one of those issues. @benhillis for visibility.
Author
Owner

@bpsib commented on GitHub (Oct 3, 2018):

The arrow keys worked as expectedly on cmd.exe when I tried on insider build 17744 so this may be fixed.

@bpsib commented on GitHub (Oct 3, 2018): The arrow keys worked as expectedly on cmd.exe when I tried on insider build 17744 so this may be fixed.
Author
Owner

@DHowett-MSFT commented on GitHub (Oct 3, 2018):

There's been a significant amount of change in WSL->Win32 interop, specifically around console applications, since build 17074. This is almost certainly fixed. Thanks!

@DHowett-MSFT commented on GitHub (Oct 3, 2018): There's been a significant amount of change in WSL->Win32 interop, specifically around console applications, since build 17074. This is almost certainly fixed. Thanks!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#62