Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Windows] Exiting a running bun process with Ctrl + C messes up the cmd command history #9952

Closed
moruzerinho6 opened this issue Apr 4, 2024 · 3 comments · Fixed by #10069
Labels
bug Something isn't working

Comments

@moruzerinho6
Copy link

What version of Bun is running?

1.1.0

What platform is your computer?

Microsoft Windows NT 10.0.22631.0 x64

What steps can reproduce the bug?

function sleep(ms) {
  return new Promise(resolve => setTimeout(resolve, ms));
}

(async () => {
  console.log('Running...')
  await sleep(10000)
  console.log('Passed.')
})()

What is the expected behavior?

While the process hasn't finished executed, if you force exit by pressing Ctrl + C and then press the up arrow to get the last command that was executed, a unrelated sequence of characters will be provided instead, such as ^[[A

Video examples:

What do you see instead?

After exiting a running process and pressing the up arrow, the last executed command should be provided, for those that don't use something like nodemon or watch mode this is extremely important to quickly run the last command again.

Video example:

unknown_2024.04.04-16.51_1.mp4

Additional information

If you continue to press the up arrow you'll constantly get the same string again and again.

image

@moruzerinho6 moruzerinho6 added the bug Something isn't working label Apr 4, 2024
@moruzerinho6
Copy link
Author

Still happens with v1.1.1

@moruzerinho6
Copy link
Author

More context, this only happens when using Windows CMD, it works as expected when using Windows PowerShell.

Jarred-Sumner added a commit that referenced this issue Apr 8, 2024
Jarred-Sumner added a commit that referenced this issue Apr 8, 2024
* Fixes #9952

* Update CMakeLists.txt

* Update CMakeLists.txt

* linux

* isolate this test
@techroy23
Copy link

I'm running the latest version of bun and this still happen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants