skeeto / skeeto/w64devkit

Launching the BusyBox shell from Windows' CMD or PowerShell and pressing Ctrl+C will overlap both shells

Open
#95 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
4.8k
Forks
381
PR merge metrics
No merged PRs in 30d

Description

I noticed this when trying to setup for myself an easy-to-use shell environment.

If I open a CMD or PowerShell window, and then launch bash.exe from the command line, and then I press Ctrl+C, it will appear like both CMD/PowerShell and the BusyBox shell will fight for my terminal. Both will print their prefixes at the same time, and it seems that each of my keystrokes is sent in alternance to each shell, so if I were to type "exit" and enter, one shell would get "xt" and the other "ei" and enter. The terminal becomes essentially unusable.

The Ctrl+C bug passes through any running command, so if I'm within the BusyBox shell running another program like GCC or even sleep 10, just one Ctrl+C will both interrupt the running program as expected, and cause the bug I describe. Pressing Ctrl+C more times does not appear to change anything, the only way that I'm aware of to work around the problem is to close and reopen the terminal.

Straightforward reproduction steps:

  1. Launch CMD or Powershell
  2. From the shell, execute BusyBox's bash.exe or sh.exe
  3. Optionally, launch a program that takes time, like sleep 10
  4. Press Ctrl+C once

The effects should be immediately visible; pressing return a few times shows the clash between the shells.

I'm not entirely sure where is the most relevant place to report this issue since I'm not sure what's in cause here; I can bump the bug report to BusyBox or elsewhere if needed.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with bash.exe or sh.exe launched from Windows CMD or PowerShell, including after Ctrl+C interrupts a command such as sleep 10. Trace the terminal and interrupt handling involved in those shell entry points; done means Ctrl+C no longer leaves both shells receiving input or printing prompts.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash, c, powershell
Domain
cli, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.