-
Notifications
You must be signed in to change notification settings - Fork 41
Description
import time
init = (time.time())
while True:
init2 = (time.time()) - init
print(f"\r{init2}", end="", flush=True)
#prints time diffa small counter i made while studying.
when i ran it, i kept getting keyboard interrupts at around 5 sec.
my solution was to add "terminal.integrated.shellIntegration.enabled": false to the user setting.json
or to disable Python Environments
the issue only exists if Python Environments and shell integration is enabled
another interesting fact is that if i added ""code-runner.executionTimeout": -1" to user settings.json and restarted vscode, then the issue was also resolved but after like 30min when i ran the code again, the issue came back. which is interesting because i dont have code runner installed.
- Enable Python Environments + shell integration
- Create a Python file with an infinite loop that does something(while True: pass works fine)
- Run it in the VS Code integrated terminal
- a KeyboardInterrupt exception is raised after ~5 sec
expectation: no keyboard interrupt after any amount of time that was not intended
reality: keyboard interrupt exception is raised after ~5 sec
versions:
Python Environments: 1.22.0
Vscode: 1.111.0
OS: linux mint 22.3
btw i tested this with different extension configurations and even if only Python and Python Environments enabled it still happens.
p.s. first time submitting a bug on github so ill be checking every now and then to see if any other info is requested
edit: also i didnt realise this at first but if "python.experiments.enabled": false in settings.json, the issue exists, but goes away if true
edit: experimental sometimes fixes the issue but not always idk