Interrupt command (ctrl+C) no longer working in VS Code 1.78 terminal on macOS
Asked Answered
D

2

6

At the top of every terminal I open is the text:
"bash: no job control in this shell"

I don't remember changing anything in VS Code but now I can no longer use 'control + c' to stop stuff in my terminal (like 'npm run dev' and 'node app.js')

Everything still works perfectly in my computer's terminal - it's just VS Code that's having issues.

I haven't tried much because I couldn't really find anything online about this exact issue. I tried ChatGPT, which told me to add some configurations to my settings.json file, but none of them worked.

Diazole answered 13/5, 2023 at 18:30 Comment(2)
I'm starting to use VScode for the first time, also on Mac, and I'm getting the same issue. Here's a screenshot of what happens when I try to Ctrl+C three times: imgur.com/a/9EbCFsqStlaurent
yes, nmjk's screenshot is exactly what I'm seeing.Diazole
B
3

I'm pretty sure this is a case of this open issue: MacOS: "no job control in this shell" #184713, which is affecting macOS users using VS Code 1.78. I suggest that you give that issue ticket a thumbs up to show that you have the issue, and subscribe to it to get notified about discussion and progress.

As a current workaround, others have found that the issue does not occur to them after downgrading to VS Code 1.77 or 1.78. Others have found that the issue goes away if they put export PROMPT_COMMAND="set -m" in one of their bash startup files, such as ~/.bash_profile.

It's been suggested that the issue might be due to use of a missing posix_spawn api in the affected versions.

If you're interested in trying to contribute a fix, the related code is in https://github.com/microsoft/node-pty/blob/main/src/unix/pty.cc, and this test would fail on affected OSes: https://github.com/microsoft/node-pty/blob/d6ce76a801f68730f7204b7b27bb21dbf8e63001/src/unixTerminal.test.ts#L123

Bouleversement answered 28/6, 2023 at 5:27 Comment(0)
F
1

If Ctrl + C isn’t working in VS Code to stop the terminal, here are a few solutions you can try:

Check Key-bindings: Open the Command Palette (Ctrl + Shift + P). Type Preferences: Open Keyboard Shortcuts and press Enter. Search for workbench.action.terminal.kill View or Editor and ensure it’s bound to Ctrl + C

I was also having same problem and thank god i have got this solution

Feer answered 6/9 at 10:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.