What I want is so simple. In Visual Studio Code, I want to copy the value of a text variable from the Watch window into memory.
I understand that, in the watch window, the text is escaped to put everything on one line. In other words,
Hello
world
is displayed as Hello\nworld
in the Watch window. That makes sense.
But when I right-click on a string variable in the Watch window and select "Copy Value", I expect the copied value to be
Hello
world
not
'Hello\nworld'
Is there a way to do this in VSC (without the tedious need to search and replace for escape characters)?
(If you're as stumped as me, Upvote in solidarity.)
Old question but here goes:
This may depend on which debugger you are using, the below works in node/JavaScript.
Go to the Debug Console tab, and type the var name or expression at the prompt.
The debugger outputs the value, and you can select and copy it from there.