17

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
  • 25,369
  • 29
  • 96
  • 135
Paula Rodrigues
  • 171
  • 1
  • 3

3 Answers3

34

Try adding this to your settings:

"[Log]": {
  "editor.wordWrap": "on"
}
Diogo Rocha
  • 9,759
  • 4
  • 48
  • 52
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
  • 25,369
  • 29
  • 96
  • 135
0

For the Debug Console you can use "debug.console.wordWrap": false,//default:true which was added in June 2019 with issue 72210

mrwolf
  • 3
  • 4