How do I use ZModem in Visual Studio Code? - visual-studio-code

Is it possible to configure vs code to support the ZMODEM protocol? I could use xshell to download files with sz command, but when I try to use sz in vs code, here it returns some random number.
(base) [alpha#hpc03 newfile]$ sz INCAR
�*B00000000000000
I use Remote-SSH extension in vs code to connect to the Linux system.
My question is:
Is there any extension or configuration method that would allow me to use sz in vs code?

As far as I know (I looked, didn't find anything) there's no existing extension or method to use the ZModem protocol with VSCode. However, there's a pull request from 2017 that adds support for it to Xterm, which is the terminal display VSCode uses. As indicated in this mentioning issue the VSCode developers would need more information.
As far as an extension goes, if you or anyone reading this wanted to make an extension for this purpose, you could use this ZModem.js implementation of the protocol in Javascript, and write the extension yourself, or do something similar.

From the Remote-SSH docs
VS Code will look for the ssh command in the PATH. Failing that, on Windows it will attempt to find ssh.exe in the default Git for Windows install path. You can also specifically tell VS Code where to find the SSH client by adding the remote.SSH.path property to settings.json.
Maybe you can include Xshell somehow this way. Or find a windows version of zssh (not this from the Ziti project) and it could work. Another candidate is SecureCRT. (via). Probably these rich GUI apps are not embeddable as simple CLI programs, though. Which would be a useful feature in this case.

Related

VSCode language extension not recognized

I have created a new extension (tmlanguage) for VSCode using the Yeoman generator.
The extension where copied to users//.vscode/extensions.
This extenxion is working fine on two of my computers and one collegua's machine.
The extension is implemented, and i can see it in the extensions browser in VSCode.
When I added this for two other colleguas, the same way I did for the 3 first computers, it doesn't work. VSCode acts as if there is noe extensions to read, or does not read them at all. As if it does not check the extension folder.
I have tried to disable all extension, then enable them again, but still the same.
In the Extension browser there is no mentioning of the new extension.
Have tried restarting VSCode.
One of the machines is Win 11, but the other is Win 10. The machines that work are all Win 10, not that I think this has something to do with it.
All running latest version of VSCode.
Is there a way to force VSCode to recognize the extensions?
Have anybody experienced similar things?
Thanks to Lex Li for pointing me in the correct direction. I thought I had followed the correct way to do this, to just copy the extension to the .vscode\extensions folder, as specified in several tutorials.
But using the vsce to generate a .vsix file did work.

Visual Studio Code Best method for Remote Workspaces

I need to handle remote workspaces in VS Code. This will allow me to edit remote source files as if they were on my local machine. Either SFTP or FTPS are the only available options, support for both would be nice. Does VS Code handle these protocols well on its own or do I need a plugin? I am familiar with creating a new SFTP/FTPS account in another IDE and i'm hoping VS Code does the same.
Should I not be using VS Code for this and instead be using maybe VS Community Edition?

Install VS Code extension during development?

I am developing an extension for VS Code. This extension is already good enough for me to use during daily work, but not good enough to be published (yet). Is there a canonical way to make an unpublished extension under development available to VS Code? Optimally, I would like to always have the current state of the code running.
I did find a way that seems to work, but I'm not sure whether this is a terrible hack or okay: Create a symbolic link in VS Code's extensions directory (~/.vscode/extensions on Linux) to the development directory. Is there a better/official way?
You can package your extension (even if it's in development) using vsce with the command vsce package. This will create a .vsix file which you can install in your regular instance of VSCode in the marketplace menu (click on the ... icon at the top and select "Install from .vsix file).
If you need to view the logs of the extension, go to Help>Toggle Developer tools and use the console to view your extension's output (if there is any).

Is it possible to run Visual Studio Code commands from Markdown?

Is it possible to run Visual Studio Code commands from Markdown? I noticed that, for example [cpptools](vscode:extension/ms-vscode.cpptools) shows the extension's page. I wondered if executing a command from the command palette would also work, and if it is something of an URI.
It proved difficult to track down the documentation but in fact this is possible, see: https://github.com/microsoft/vscode/issues/140733
Say your command is referenced as pkg.command, then this URL in Markdown can be clicked to execute it:
[Run It](command:pkg.command)
This works out of the box in modern VSCode.
Link processing using protocol vscode for example [cpptools](vscode:extension/ms-vscode.cpptools) is performed only by Visual Studio Code. For now, it handles links if they point to extensions, but does not support link to commands. But the Visual Studio Code development team can add this if they see fit for the developers.
But, in my opinion, this functionality is not necessary.

Is it possible to specify the path to the libstdc++ in VS Code clangd extension?

I use VS Code as my main code editor for my C++ development. I am using the remote SSH extension by Microsoft to access my office workstation from home. For the C++ autocompletion and linting I use the clangd extension by LLVM. Company policy prevents users from having sudo access to workstations and libraries are often not at the latest version.
When I try to launch clangd I get the following error message:
/lib64/libstdc++.so.6: version `GLIBCXX_3.4.22' not found (required by /my/path/to/clangd)
Which obviously means that the version of libstdc++ is too old for the version of clangd that I am using. This is easily fixable by adding to LD_LIBRARY_PATH the location of most recent gcc libraries (part of our compiler toolchain) and then launching VS Code.
However, now that I am working remotely I cannot do that because VS Code is installed onto my laptop and I am using the SSH extension to access the code on my office workstation. Looking on the man page for clangd I cannot see a way to specify the path to the libstdc++ that I want to use. Is there a way, other than adding the libraries to the LD_LIBRARY_PATH upon startup/login, to bypass this issue?
I found a way, albeit a little bit hacky.
Export the new LD_LIBRARY_PATH on .zprofile (or equivalent for your shell. I am using zsh). Make sure that there are no VSCode servers running in the host. If there are, make sure to remove them.
In the settings.json file add the following line, to tell VSCode that you want the shell to be a login, interactive shell:
"terminal.integrated.shellArgs.linux": ["-l", "-i"]
Job done. Clangd now finds the correct libraries.
Another way to do this is to use env in your settings.json as follows:
"clangd.path": "env",
"clangd.arguments": [
"LD_LIBRARY_PATH=<your_custom_path>",
"/path/to/my/clangd"
],