15

I'm running my code using the extension "Code Runner" and would like the output to be displayed word-wrapped. Currently when I run it, it displays the output all in a single line even if it's a long line.

I tried the setting "editor.wordWrap": "on".

This is how the output and editor look like:

This is how the output and editor look like:

Gino Mempin
  • 19,150
  • 23
  • 79
  • 104
Paula Rodrigues
  • 151
  • 1
  • 3

2 Answers2

33

Try adding this to your settings:

"[Log]": {
  "editor.wordWrap": "on"
}
Diogo Rocha
  • 8,159
  • 3
  • 48
  • 51
2

You can instead use the built-in debugger configuration for Python and set in launch configuration to use the "internalConsole"

{
    "name": "run-test-py",
    "type": "python",
    "request": "launch",
    "program": "${workspaceFolder}/myfile.py",
    "console": "internalConsole"
},

so that the output appears in the Debug Console panel. The word wrapping for that panel is controlled by the Debug > Console: Word Wrap setting:

vscode setting

Set it to true:

"debug.console.wordWrap": false,

debug console

Gino Mempin
  • 19,150
  • 23
  • 79
  • 104