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

Native notebooks: Whitespace at start of output suppressed #4254

Closed
gvanrossum opened this issue Dec 19, 2020 · 3 comments
Closed

Native notebooks: Whitespace at start of output suppressed #4254

gvanrossum opened this issue Dec 19, 2020 · 3 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug

Comments

@gvanrossum
Copy link

Environment data

Version: 1.53.0-insider (system setup)
Commit: c927a8015b9e26bd454d6e293bb0384aa1975d06
Date: 2020-12-18T05:27:48.567Z
Electron: 11.0.5
Chrome: 87.0.4280.88
Node.js: 12.18.3
V8: 8.7.220.29-electron.0
OS: Windows_NT x64 10.0.19042
  • Jupyter Extension version (available under the Extensions sidebar): v2020.12.414227025
  • Python Extension version (available under the Extensions sidebar): v2021.1.416706931
  • OS (Windows | Mac | Linux distro) and version: Windows 10
  • Python and/or Anaconda version: 3.8.6
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): None
  • Jupyter server running: (No idea)

Expected behavior

print("  ho")
print("  ho")
print("  ho")

Expected output:

  ho
  ho
  ho

Actual behavior

The spaces at the start of the first line are not rendered:

ho
  ho
  ho

Steps to reproduce:

image

@gvanrossum gvanrossum added the bug Issue identified by VS Code Team member as probable bug label Dec 19, 2020
@joyceerhl
Copy link
Contributor

Hi @gvanrossum thanks for reporting a bug! I can repro this behavior:

image

The leading whitespace is being stripped when processing the output that comes back from the kernel here:

['text/plain']: concatMultilineString(output.text, true)

I'm not sure why we were trimming whitespace before (@DonJayamanne might know), but the fix would be to change that line to:

 ['text/plain']: concatMultilineString(output.text) 

With that change:
image

@IanMatthewHuff
Copy link
Member

IanMatthewHuff commented Dec 22, 2020

@joyceerhl If I recall correctly we had this issue with the old notebooks and fixed it. I remember customers having issues with output formatting of tables due to this. Think we might have fixed it in old notebooks, but not in the native notebooks code that branched out, downsides of us still having implementation separation with old / native notebooks. Good catch on seeing the fix already.

@IanMatthewHuff
Copy link
Member

Validated.
image

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

3 participants