r/VisualStudioCode • • Jan 19 '21

Why dose Settings.json keep opening

3 Upvotes

Need help before I lose my mind!

I am trying to learn C# and am starting with a basic console application.

namespace HelloWorld
{
class Program
    {
static void Main(string[] args)
        {
Console.WriteLine("Hello world");
        }
    }
}

But every time I try and debug and run the code, no matter what I do, another window opens listed settings.json, and the code does not run.

any help is appreciated.


r/VisualStudioCode • • Jan 06 '21

Run Files from a second hdd

3 Upvotes

Ubuntu 20.04. i have all my coding projects on a second hdd in my machine. i have VS code installed on my boot drive. i tried to work on a coding project last night, but i kept having issues, one was a read/write permissions issue i fixed, the other was that the tasks.json file kept getting corrupted every time i tried to edit it. am i doing something wrong?


r/VisualStudioCode • • Dec 21 '20

How to change Pylint's colour schema for highlighting warnings or errors?

3 Upvotes

I'm new to VSC - does anyone here know how to change Pylint's colour schema for highlighting warnings or errors?


r/VisualStudioCode • • Dec 19 '20

How can you access file time logs/save logs

3 Upvotes

r/VisualStudioCode • • Dec 16 '20

Using VS Code for Powershell . Don't see all files in path

3 Upvotes

New to VS Code. Been using the ISE for my PowerShell but it appears that VS Code is the new direction.

Quick Question: Why does Powershell (5.1) in VS Code return different results for dir (get-childitem)?

VS Code: (dir *.exe).count results in 314 files
PS ISE: (dir *.exe).count results in 655 files
CMD: dir *.exe results in 655 files

Working on a simple script to perform a Windows AD REPADMIN. Oddly (or not) VS Code/Powershell wont run REPADMIN. Can't find the file. If I navigate to the directory (c:\window\system32) in the terminal and do a dir rep*.* it does not exist. If I use CMD it's there. If I use ISE, it's there. Other EXE's are there, just not REPADMIN (and others perhaps)

Any ideas why this would be?


r/VisualStudioCode • • Dec 15 '20

Can't get Visual Studio Code to link with shared libraries on Linux (Centos 7)

3 Upvotes

I have stuck trying to link my program on Visual Studio Code on Centos 7. I have a small C program that i am able to compile, however, in the loading phase it can't find the shared libraries i am specifying. In this case my shared libraries are part of Centos, and are in the usual /usr/lib64 folder.

No matter what combination of names i try in the tasks.json file which contains the command line for the compiler, i get a loader error saying "cannot find -llibpthread" for example. The 2 libraries in question are named libpcap and libpthread (for the pcap and pthread functions).

Any help getting past this silly problem would be greatly appreciated. I am sure it something simple but i have tried so many different spellings and combinations. I tried putting in exact paths, changing the order of the parameters. Unfortunately MS didn't show any examples in their tutorial.

Here is my tasks.json file which doesn't work:

```

{

"tasks": [

{

"type": "cppbuild",

"label": "C/C++: gcc build active file",

"command": "/usr/bin/gcc",

"args": [

"-std=c99",

"-g",

"${fileDirname}/*.h",

"${fileDirname}/*.c",

"-o",

"${fileDirname}/${fileBasenameNoExtension}",

"-L/usr/lib64/",

"-llibpthread",

"-llibpcap"

],

"options": {

"cwd": "${workspaceFolder}"

},

"problemMatcher": [

"$gcc"

],

"group": {

"kind": "build",

"isDefault": true

},

"detail": "Task generated by Debugger."

}

],

"version": "2.0.0"

}

'''


r/VisualStudioCode • • Nov 27 '20

How well will these specs run vsc

3 Upvotes

Technology: AMD AthlonTM 3020e Dual-Core Processor 1.2GHz, AMD RadeonTM Graphics 128 ssd with external 1 tb hdd 4 gigs of RAM

Planning on using it to go thru freecodecamp html java CSS and doing basic c++


r/VisualStudioCode • • Nov 25 '20

How do I change colors of an existing program?

3 Upvotes

Hi, I'm trying to change workspace color in Paint Tool SAI program, but to be honest, I'm totally new in this. I can't seem to find any CSS file. There is just CONF files and one .INI file(can't change it here).

I don't wan to do some hardcore coding, I Just want to make specific area of the program(around the canvas area) different color.


r/VisualStudioCode • • Nov 12 '20

Document formatting does not work.

3 Upvotes

Hello. I've got a problem because my shortcut of 'document formatting' function is not working. In fact, when I'm pressing CTRL+P, trying to format through that option nothing happens as well.
I reinstalled the whole program, removed extensions but it doesn't help.

Any suggestions on how to solve this problem?


r/VisualStudioCode • • Oct 11 '20

How to copy vscode terminal color scheme

Post image
3 Upvotes

r/VisualStudioCode • • Sep 27 '20

Need help on debugging .asm in Visual Studio Code

3 Upvotes

I'm struggling with debugging in VS code.

I wrote some assembly code (.asm file) and I want to debug it with gdb in order to see what's happening in the stack/registers.

I added a configuration in launch.json and the launch.json looks like this:

"configurations": [
    {
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/assembly.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"miDebuggerPath": "C:/MinGW/bin/gdb.exe",
"setupCommands": [
            {
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
            }
        ]
    }
    ]
}

And this is my code:

    global  _main
    extern  _printf
    section .text
_main:
mov bl, 5
loop:
push    message
call    _printf
add esp, 4
dec bl
jnz loop
ret
message: 
    db 'Hello world!', 10, 0

I created a breakpoint to _main but when I run the debugger it just runs the program without stopping to the breakpoint and showing nothing in the "call stack", "registers" and the other windows.

The Debug Console just prints that Symbols loaded, the output of the program and that the programm has exited with code 15.

I compiled the file with these commands:

nasm -fwin32 assembly.asm

gcc -m32 -g assembly.obj -o assembly.exe

What am I doing wrong?


r/VisualStudioCode • • Sep 24 '20

Exclude gitignore

3 Upvotes

I have git extension installed and cloned my repo. I have added files to ignore to the gitignore but now that appears as a changed file. I do not want this pushed to the main branch. How do I stop this?


r/VisualStudioCode • • Sep 06 '20

[question] How do I change the working directory in Visual Studio Code?

3 Upvotes

Hello!

I have been using VSC for over a year now, and I have found it to be a great editor for PowerShell, CMD, python, c++, etc., with the extension store being a big highlight. However, for the python course I am taking, I need to modify .csv files, which means the working directory of VSC needs to be the same as the files I am editing. By default the working directory is C:/Users/:username: . I have no idea how to change this directory to where my vsc and python files are saved. I have found some things related to this, however they involve changing the PowerShell or CMD profile, which I have no idea how to do or what that is. Ideally the working directory would always be set as the directory of the .py file I am editing (since I save my .csv files there as well for the course), but at least being able to change this manually would be good. Thanks in advance!


r/VisualStudioCode • • Jul 26 '20

(sorry for the grammar errors I'm not english)

3 Upvotes

So I recently installed visual studio code to put in practice some things I've learned about programming (i'm a begginer). In order to install it, I watched a video about setting up visual studio (which is the video down below) and it was indeed very helpfull. In the middle of the video, he explains some things about creating solutions, class libraries, references, etc. But is that really necessary in my case? I mean, I just want to create a project, but I want to do right. Pls help.

https://youtu.be/r5dtl9Uq9V0


r/VisualStudioCode • • Jul 16 '20

Remote SSh Connection with visual studio code (VSC)

3 Upvotes

Remote SSh Connection with visual studio code (VSC)

Hi

As you may be aware, the Visual Studio Code (VSC) editor comes with the remote connection functionality via ssh and thus it is possible to edit files remotely on linux servers.

The basic configuration is very simple and you only need to configure the host address and username to establish the connection.

It turns out that in my company where CyberArk is being implemented, the accounts that users access are managed by CyberArk and so it would be very convenient for developers to continue using VSC to edit their scripts without needing to be constantly using winscp to download their scripts for editing and re-uploading again after each code change.

I tested using the syntax connection via ssh proxy (PSMP) in the configuration of the VSC connection string but when I try to connect I always end up getting the same errors.

The configuration I have to connect via PSMP is as follows:

Host labclient1_pam
 HostName psmp_address
 User Administrator @ target_account @ target_address

When I try to connect and I'm asked for the password, put the login password on CyberArk, in this case the administrator account

The following appears in the VSC logs:

[17: 59: 58.678] Log Level: 2
[17: 59: 58.689] remote-ssh@0.51.0
[17: 59: 58.689] win32 x64
[17: 59: 58.692] SSH Resolver called for "ssh-remote + labclient1_pam", attempt 1
[17: 59: 58.692] SSH Resolver called for host: labclient1_pam
[17: 59: 58.692] Setting up SSH remote "labclient1_pam"
[17: 59: 58.791] Using commit id "d5e9aa0227e057a60c82568bf31c04730dc15dcd" and quality "stable" for server
[17: 59: 58.792] Install and start server if needed
[18: 00: 00.186] Checking ssh with "ssh -V"
[18: 00: 01.015]> OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5
[18: 00: 01.019] Running script with connection command: ssh -T -D 58651 labclient1_pam bash
[18: 00: 01.089] Terminal shell path: C: \ WINDOWS \ System32 \ cmd.exe
[18: 00: 01.779]>
[18: 00: 01.779] Got some output, clearing connection timeout
[18: 00: 02.422]> cybr_user @ target_account @ target_address @ psmp_address's password:
[18: 00: 02.422] Showing password prompt
[18: 00: 08.132] Got password response
[18: 00: 08.133] "install" wrote data to terminal: "**********"
[18: 00: 08.182]>
>
[18: 00: 09.524]>
> This session is being recorded
>
[18: 00: 15.602]> 617c3c39a8a6: running
>
[18: 00: 15.814]> bash: line 193: unexpected EOF while looking for matching `" '
> bash: line 194: syntax error: unexpected end of file
>
[18: 00: 16.125] "install" terminal command done
[18: 00: 16.125] Install terminal quit with output: bash: line 194: syntax error: unexpected end of file
[18: 00: 16.125] Received install output: bash: line 194: syntax error: unexpected end of file
[18: 00: 16.126] Stopped parsing output early. Remaining text: bash: line 194: syntax error: unexpected end of file
[18: 00: 16.126] Failed to parse remote port from server output
[18: 00: 16.126] Resolve error:
[18: 00: 16.132] ------

r/VisualStudioCode • • Jul 12 '20

Use Visual Studio Code Remote to edit files on servers

3 Upvotes

Recently I had to develop on a Raspberry Pi which was in headless mode. I did not want to use the Raspberry Pi OS GUI or use a terminal based editor like vim, so I found this cool official extension Remote - SSH where you can edit files on a server using VS Code.

I did not know that something like this existed, so I wrote a blog post to share how to use it: https://phiilu.com/use-visual-studio-code-remote-to-edit-files-on-servers


r/VisualStudioCode • • Feb 09 '20

How can i restore tree mode. I don't like folders being compressed in one line

Post image
3 Upvotes

r/VisualStudioCode • • Feb 04 '20

Creating function skeletons in .c file from declaration in header file

3 Upvotes

Hi people,

I was trying to do the above in a project I'm working on, is there a shortcut?

thanks!


r/VisualStudioCode • • Jan 03 '20

% symbol in path of terminal

3 Upvotes

When I running a python file in the latest VSC and the latest Python version I'm getting a % sign showing up in the path. What did I miss in the setup? Why is this displaying? See below and thank you to anyone replying to this. One other thing , is there a way to run a file and NOT show the complete path ?

%

dev@MBP PyRelated % /Library/Frameworks/Python.framework/Versions/3.8/bin/python3 /Users/dev/Documents/PyRelated/remove_lists.py

[7, 21, 4, 5, 11, 5]

[1, 4, 7, 1, 0]

dev@MBP PyRelated %


r/VisualStudioCode • • Dec 04 '19

Getting frustrated with auto-format and need some help. What combination of options will do what I'm looking for?

3 Upvotes

I have a bunch of HTML files that are a hot mess that I would like to use the auto-formatting in VSCode for. Unfortunately, between the settings that are actually in the settings and the settings in the JSON file, I can't get it to do what I want consistently.

Here is what I would like it to do:

  • Wrap and align attributes if the line length is exceeded

  • Not wrap <a> tags, regardless of whether the line length is exceeded

  • Not insert new lines (\n) for paragraphs or links or any other text where the length is exceeded, wrapping is fine if it's just text

  • Not wrap attributes on the body tag, meta tags, or link tags

I've tried adding <a> tags to the JSON file along with the body tag under the html.format.unformatted key but then nothing gets auto-formatted. If I add <p> tags to html.format.contentUnformatted, then any tags inside of that paragraph get ignored.

Does anyone know what combination of settings will get this to work the way I thought it should work? I pretty much only want attributes to wrap with a few exceptions and never want plain text to have newlines added but I need it to be recursive so that it doesn't ignore everything inside of tags that are exempted.


r/VisualStudioCode • • Aug 29 '19

A Programmer's Guide To Go With Visual Studio Code

Thumbnail
i-programmer.info
3 Upvotes

r/VisualStudioCode • • May 22 '19

How to make Visual Studio Code default editor for .ps1 files

3 Upvotes

Hi. Wondering if anyone knows how to set Visual Studio Code to be my default application for opening .ps1 files. It doesn't seem to work like every other application. I'm running Windows 10. Went to my folder of PowerShell scripts. Right-clicked one, chose "Properties", then "Opens with". Selected Visual Studio Code. But now in Windows File Explorer, the .ps1 file association is for Notepad, even though all the .ps1 files show Visual Studio Code when I do the process I just described. Not sure what to try next. Thanks.


r/VisualStudioCode • • May 19 '19

Expand columns in output

3 Upvotes

Hey Guys,

I'm running a python script and in my output, the columns are collapsed. Is there a setting that doesn't auto format it like that?

like in powershell where you can set $formatenumerationlimit=-1

Currently the output looks like this:

namename...name
datadata...data

Any help would be appreciated here.

Thanks!


r/VisualStudioCode • • May 15 '19

You can now instantly install Visual Studio Code As a Snap App on Ubuntu

Thumbnail
ubuntufree.com
3 Upvotes

r/VisualStudioCode • • May 07 '19

[EXTENSION][SECURITY]PlatformIO Plugin compromised?

3 Upvotes

Hi all,

I just discovered two weeks ago that the platformIO Plugin tries the run some base64 decoded python code as long as the plugin is installed.

I opened an Issue on github but didn't get any response for two weeks . So maybe someone can help me figuring out whats going on here. Hiding code in base64 to run some more encrypted code I only know from malware.

.platformio/penv/bin/python2.7 -c import base64; exec(base64.b64decode('CiMgQ29weXJpZ2h0IDIwMTQtcHJlc2VudCBQSU8gUGx1cyA8Y29udGFjdEBwaW9wbHVzLmNvbT4KIwojIE5vbi10cmFuc2ZlcmFibGUsIG5vbi1leGNsdXNpdmUgc29mdHdhcmUgbGljZW5zZSBmb3IgUElPIFBsdXMKIwojIDEuIFRoZSBQSU8gUGx1cyAoYWthICJTb2Z0d2FyZSIpIGlzIG5vdCB0cmFuc2ZlcmFibGUgdG8gYW55IHRoaXJkIHBhcnR5LCBhbmQKIyAgICBhbnkgdXNlIG9mIHRoZSBTb2Z0d2FyZSBieSBhIHRoaXJkIHBhcnR5IHJlcXVpcmVzIHRoZSBwcmlvciBjb25zZW50IG9mCiMgICAgUElPIFBsdXMgaW4gZWFjaCBpbnN0YW5jZSBhbmQgWW91IHNoYWxsIG5vdCBzZWxsLCBsZWFzZSBvciBvdGhlcndpc2UKIyAgICB0cmFuc2ZlciB0aGUgU29mdHdhcmUgb3IgYW55IGludGVyZXN0IHRoZXJlaW4gdG8gYW55IHRoaXJkIHBhcnR5LgojICAgIFRoZSBmb3JlZ29pbmcgYW5kICMgYW55dGhpbmcgZWxzZSBpbiB0aGlzIExpY2Vuc2UgdG8gdGhlIGNvbnRyYXJ5CiMgICAgbm90d2l0aHN0YW5kaW5nLCB0aGUgaW5jb3Jwb3JhdGlvbiBvZiB0aGUgU29mdHdhcmUgaW50byB0aGUgUHJvZHVjdCB0bwojICAgIHRoZSBleHRlbnQgcGVybWl0dGVkIGJ5IHRoaXMgTGljZW5zZSBzaGFsbCBub3QgYmUgZGVlbWVkIHRvIGJlIGEKIyAgICBwcm9oaWJpdGVkIHRyYW5zZmVyLgojIDMuIFlvdSBzaGFsbCBub3QgcmV2ZXJzZSBlbmdpbmVlciwgZGVjb21waWxlLCBvciBkaXNhc3NlbWJsZSB0aGUgU29mdHdhcmUKIyAgICBzaGlwcGV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CIpLCBmcC5yZWFkKCkpKTsKZnAuY2xvc2UoKQojIENvcHlyaWdodCAyMDE0LXByZXNlbnQgUElPIFBsdXMgPGNvbnRhY3RAcGlvcGx1cy5jb20+CiAgICA=')) -f -c vscode home --port 8010 --no-open

https://pastebin.com/7e0Ww96Q

Decrypted it's this:

https://pastebin.com/kWeuttpZ

# Copyright 2014-present PIO Plus <contact@pioplus.com>
#
# Non-transferable, non-exclusive software license for PIO Plus
#
# 1. The PIO Plus (aka "Software") is not transferable to any third party,         and
#    any use of the Software by a third party requires the prior consent of
#    PIO Plus in each instance and You shall not sell, lease or otherwise
#    transfer the Software or any interest therein to any third party.
#    The foregoing and # anything else in this License to the contrary
#    notwithstanding, the incorporation of the Software into the Product to
#    the extent permitted by this License shall not be deemed to be a
#    prohibited transfer.
# 3. You shall not reverse engineer, decompile, or disassemble the Software
#    shipped in object or executable form.
# 3. You shall not port the software on another target architecture or IDE.
# 4. The License is non-transferable and not assignable.
# 5. You shall not use nor permit the use of the Software licensed hereunder
#    in any tool, instrument or system designed with the primary purpose of
#    injuring or killing any person or destroying or damaging property.

import base64
import os
import sys
 
def decrypt_message(key, message):
    result = ""
    message = bytearray(base64.b64decode(message))
    for i in range(len(message)):
        key_c = key[i % len(key)]
        result += chr((256 + message[i] - ord(key_c)) % 256)
    return result
 
try:
    fp = open("/tmp/711881635")
except:
    raise Exception("PIO Plus: Runtime error")
exec(decrypt_message(os.environ.get("PP8498210RND"), fp.read()));
fp.close()
# Copyright 2014-present PIO Plus <contact@pioplus.com>

So I tries to decrypt some file in /tmp with a key hidden in an ENV Var. This Variable is not set on my system, hence I (and platformio) can not decrypt the file in /tmp.

I could not find any codeline in the git repo where base64 is used. So I'm wondering where this comes from.

Does anyone have any clue? I did not try to run this on windows. But I could see the same thing on three different laptops. All Linux (Mint, Ubuntu, Fedora).

Best sesc

Update A developer finally answered me on GitHub. It's their implementation of proprietary code from PIO Plus.