Insung kim
Insung kim

Reputation: 21

VS Code - Hide file path in debug console

In VS Code's debug console, how can I hide the long file path at the right of every line?

screenshot

Upvotes: 2

Views: 938

Answers (2)

Vitalik Brezitsky
Vitalik Brezitsky

Reputation: 41

As a temporary solution you can disable "words wrap" in console settings. This adds horizontal scrollbar in debugger console.

Upvotes: 4

Mark
Mark

Reputation: 180695

See the issue https://github.com/microsoft/vscode/issues/115625 (Hide or shorten path in Debug Console) which has been implemented and is in the Insiders' Build v1.54.

It shortens the file but does not hide it. In my testing this

c:\Users\Mark\AppData\Local\Programs\Microsoft VS Code\resources\app\out\bootstrap-fork.js

was shortened to

...Code Insiders\resources\app\out\bootstrap-fork.js:5

It doesn't appear to be configurable in any way but is a welcome improvement IMO.


Following up on @rioV8's suggestion here is the themeable reference to those source file paths:

"workbench.colorCustomizations": {
    "debugConsole.sourceForeground": "#0000"
}

The last digit of that hex color is opacity. Even if you set the opacity to 0, you can still hover and see the file name and click on it as if it was shown.

But switching off the opacity will have no effect on where your debug values break or wrap into the next line. That wrap still operates as if the source file name was fully visible - which may have been your biggest concern.

Upvotes: 0

Related Questions