#PyDev-776: No variables displayed when debugging connected to console
@@ -457,7 +457,9 @@ class PyDB:
# TODO: Investigate: should we do this for all threads in threading.enumerate()?
# (i.e.: if a fork happens on Linux, this seems likely).
old_thread_id = get_thread_id(t)
-
+ if old_thread_id != 'console_main':
+ # The console_main is a special thread id used in the console and its id should never be reset
+ # (otherwise we may no longer be able to get its variables -- see: https://www.brainwy.com/tracker/PyDev/776).
clear_cached_thread_id(t)
clear_cached_thread_id(threadingCurrentThread())
