简体   繁体   中英

How do I turn on word wrap for Output window in VS code?

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:

这是输出和编辑器的样子:

Try adding this to your settings:

"[Log]": {
  "editor.wordWrap": "on"
}

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设置

Set it to true :

"debug.console.wordWrap": false,

调试控制台

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM