code command using ssh-remote pluguin using bash - bash

Is there a way to open the visual studio code using "code" command on linux terminal but opening it with a specific ssh folder.
On documentation i have read that you can open an specific path with code command but what i want to know if this is also possible with an ssh folder using the ssh-Remote plugin.
code /path/
Visual studio code also stores your ssh folders on recent folders so i wish that there's a command to call that path or something like that.

Related

Ftp Windows Command Line Command Not Working

I'm using Windows command line for getting some files from a ftp server.
I need to change the local directory during the session.
I tried using 'lcd' command but it's not working. I displayed that the command is executed correctly but when i download the files they are downloaded on another directory (default?).
Retyping 'lcd' to show the actual local directory i can see it does not change.
The code i used is written below
lcd C:\Myfolder\MySubFolder
I tryed also the cmd with administrative priviledges, but it is the same.
Thank You.

Add and Open Project Folder in Visual Studio Code using ZSH Terminal?

I am following a series of tutorials to learn command line and, my teacher open and adds the project folder in Atom using the command
atom .
but she is using bash shell, and I am using zsh (is the default shell macOS has since Catalina) and visual studio code.
I've tried the following commands unsuccessfully:
Visual\ Studio\ Code -a
open -a 'Visual Studio Code'
code .
open Visual\ Studio\ Code .
I just want to know what is the equivalent command to her atom . but for vs code in zsh.
The problem was that actually I needed to install the code command to PATH as specified in the official VS Code documentation:
https://code.visualstudio.com/docs/setup/mac
Launch VS Code.
Open the Command Palette (Cmd+Shift+P) and type shell command to find the Shell Command: Install 'code' command in PATH command.
Restart the terminal for the new $PATH value to take effect.
So now you'll be able to type code . in any folder to start editing files in that folder, just like in my atom . example

How to set an alias to open a file in Bash

I am trying to set an alias to open an Excel file from a directory on Windows 7. Each time I use the alias it just opens a Windows Explorer window in the root directory.
I am entering:
alias openExcel="explorer /z/Company/AP/PR/thisExcelFile.xlsx"
I have also tried:
alias pr="cd /z/Company/AP/PR/"
Then:
alias openExcel="explorer thisExcelFile.xlsx"
Running these commands manually opens the Excel file. But using the commands through an alias just opens Windows Explorer in the root directory.
I have also tried combining the bottom two commands in a function but that didn't work either.
Can alias' not be used to open files like this? Is there some exception to how an alias works when you use the 'explorer' command on Windows?
Your commands are fine - you're just running the wrong application.
The first part is the command/executable, and the second is the argument. You just need to open the file with Excel.
// This runs "Windows Explorer", with the parameter "thisExcelFile.xlsx"
explorer thisExcelFile.xlsx
// This runs "Microsoft Excel", with the parameter "thisExcelFile.xlsx"
excel thisExcelFile.xlsx
You can do the same with winword myWordDoc.docx, or firefox www.google.com.
It may also be a good idea to quote the argument, just in case:
excel "thisExcelFile.xlsx"

How to Open a Git Bash Shell inside Box Drive folder

I am attempting to open a bash shell inside my Box folder. However, I get the following error:
"This file does not have an app associated with it for performing this action. Please install an app or, if one is already installed, create an association in the Default Apps Settings page.
When I right click and select 'Git Bash Here' in Dropbox, however, the Bash shell opens successfully.
I know you can associate a WSL bash shell to .sh files (on Windows 1, with the WSL feature activated)
You could adapt that script in order to not call "%SYSTEMROOT%\System32\bash.exe" (the WSL bash) but C:\path\to\git\bash.exe
But first, check if the issue persists outside a dropbox folder.

Possible to Auto Open file in Visual Studio

I currently use the following cleartool command using Visual Studios External tool interface:
Command: \installationpath\cleartool.exe
Arguments: annotate -nheader $(ItemPath)
Initial directory: $(ItemDir)
I do use the output window. Which will let that command print out the location of the .ann file it produces. I'm wondering if there is a way for Visual studio to auto open that produced file?
In this case its not a huge hardship to copy the location and open the file. I'm just always looking for ways to make things easier.
Using just one external tool, you wouldn't be able to execute cleartool, and to open a file (generated from the cleartool command).
You can open a file from a Visual Studio External Tool as explained here, but that wouldn't execute cleartool.
So I would recommend executing a script (.bat, .cmd, .vbs) in order to:
do the cleartool command you want
open the generated file.
You would pass to this script no only $(ItemPath), but also, depending on where it is generated, $(ItemDir), or $(ProjectDir), or $(SolutionDir), or $(TargetDir).

Resources