Skip to content

Python Interactive Windows errors with vscode-remote #3399

@vnijs

Description

@vnijs

Environment data

  • VS Code version: insider-version 1.34.0
  • Extension version (available under the Extensions sidebar): tried current and insider-version but makes no difference
  • OS and version: Docker with ubuntu 18.04 on macOS Mojave
  • Python version (& distribution if applicable, e.g. Anaconda): 3.6.7
  • Type of virtual environment used: N/A

Expected behaviour

Python code running in the Python Interactive Window

Actual behaviour

image

Steps to reproduce:

  1. Create a project directory with a sub directory with a .devcontainer/devcontainer.json file as follows:
{
	"name": "rsm-msba",
	"image": "vnijs/rsm-msba",
	"workspaceFolder": "/",
	"extensions": [
		"ms-python.python"
	]
}
  1. Try to run the python code below in the Python interactive window. This works in the standard terminal but I get the strange output as shown in the screenshot above in the interactive window

cc-ing @chrmarti in case he has any comments/suggestions

#-------------------------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
#-------------------------------------------------------------------------------------------------------------

#%%
import matplotlib
import matplotlib.pyplot as plt
import numpy as np

# Data for plotting
t = np.arange(0.0, 2.0, 0.01)
s = 1 + np.sin(2 * np.pi * t)

fig, ax = plt.subplots()
ax.plot(t, s)

ax.set(xlabel='time (s)', ylabel='voltage (mV)',
       title='About as simple as it gets, folks')
ax.grid()

fig.savefig("plot.png")
plt.show()

print('Open test-project/plot.png to see the result!')


# %%

import os
print(os.getcwd())

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions