To open a folder in Terminal - terminal

Is there any option to open the program files in Terminal(windows) directly from the folder's location in the drive, without actually typing all the commands to navigate and then executing it.
I guess "open in Terminal" option in present in Ubuntu;

You can achieve this in a number of ways.
Click on File at the top left corner of the current folder location. You will see Open Windows PowerShell option. Click on any option. It will open Power Shell and automatically navigate to the current folder.
Another option, Press Shift and Right Click. It will show Open PowerShell window here option.
If you are looking for Ubuntu-like terminal(bash) then you can install the Git terminal from here. Then, on right-click you will see Git Bash Here option.

Related

Using cmder . Windows 10

I downloaded Cmder on my PC but I want that the cmd starts on a folder as then I can navigate because if not the cmd starts in the Cmder folder and I can't go anywhere. Can someone help me, please? Wish you understood me!
Very simple and best way to get CMDER wherever you want is adding it to de Windows Context Menu (right click).
Open a terminal as an Administrator
Navigate to the directory you have placed Cmder
Execute .\cmder.exe /REGISTER ALL
If you get a message "Access Denied" ensure you are executing the command in an Administrator prompt.
In a file explorer window right click in or on a directory to see "Cmder Here" in the context menu.
From: https://github.com/cmderdev/cmder#shortcut-to-open-cmder-in-a-chosen-folder
Tip: put the CMDER files in c:\Program Files\CMDER
If I understood you correctly, you want to change the directory you start from each time you open a new terminal.
To do that:
click Win+Alt+t to open the settings
In the settings group 'Startup' choose 'Tasks'
Choose the console you want to modify (e.g. cmd::Cmder, cmd::Cmder as Admin, etc..)
Click the 'Startup dir...' button
Select the directory you want the console to startup in by default
Enjoy!
You dont give us much to go on but you should have a shortcut with which to start cmder perhaps on your desktop something like this.
If not find your installed copy of cmder.exe then Right Click it then select Send To
and then finally select "Desktop (as shortcut)"
Right click the shortcut and select Properties of that shortcut and then add your prefered starting DIRectory after a /start DIRective
If you want to Autorun other start-up commands see
https://stackoverflow.com/a/68185482/10802527

"Open in Integrated Terminal" in vscode in current integrated terminal, not a new one

In vscode, right-clicking in the explorer on a file (or folder) and selecting "Open in Integrated Terminal" will create a new integrated terminal at the path of that directory.
Is there a way to open that directory in the currently open integrated terminal? Ideally without having to copy the path and type "cd " and paste the path.
I feel like I'm missing something.
If not, are there any extensions that do this? Using macOS.
What I've Tried
I've searched for and could not find a way to do this.
I use the vscode extension "Terminal Sync", but you must have a file open in the editor and the file must be the current one being used in order to cd into that file's directory in the integrated terminal

How can I open command prompt in the current directory as a shortcut

I'm just wondering how I can make a shortcut that will open command prompt in the folder it is currently in.
Why I need this.
I save my c program file in the directory Users\PC\Documents\Other\My_Programs\WIP\Project_1\Test\
So I would have to type cd Users\PC\Documents\Other\My_Programs\WIP\Project_1\Test\ every time I want to open the command prompt in that directory.
Is there a shortcut I can make where I can move that shortcut around anywhere (don't need to change the shortcut) and it will open command prompt in the directory it is current in, so I don't need to keep typing cd .....
you can go to the directory and just type start . in the same directory
or you can make a batch file like test.bat and add below line in the same:
cd Users\PC\Documents\Other\My_Programs\WIP\Project_1\Test\
Save it anywhere and whenever you will run that batchfile, it will automatically move PWD to the required directory
Right-click in the open space of your desktop and click New > Shortcut
For the location, type or copy and paste one of the following lines.
%windir%\system32\cmd.exe /k cd Users\PC\Documents\Other\My_Programs\WIP\Project_1\Test\
As commented by aschipfl, you can already do it, (may be OS dependent)!
In Windows Explorer, or I suppose the desktop, just hold down the shift key, right click in a blank area of it and choose Open command window here, (or whatever your locale states).
I think in Windows 10 at least, the option is even available in the Explorer toolbar menu too.

"git bash here" of subcontext menu opens in windows root path

Right clicking a folder in windows opens the submenu of a windows right click. Where you have the basic OS operations like "Open", "Edit", "rename" etc.
If git is installed you also have the option to "git bash here". This command should open the terminal/cmd and directly point to the right-clicked folder. But it's always openening in the root system folder.
tl;dr; clicking "git bash here" opens the system root folder instead of the right-clicked one
The way I solve my own problem is to uninstall Git, and delete .bashrc manually (cause uninstall Git doesn't remove that file), and install Git again. And the terminal open correctly in my working folder rather than root system folder. Thanks to Todd.
As one of the comments suggest, the .bashrc file is the one to "blame".
Deleting it would solve the issue.
However, it contains valuable declarations. So "don't throw the baby out with the bathwater": a minor edit would do the trick:
Open Git Bash window. While the bash is active, enter the following:
vim ~/.bashrc
In my case, the bottom line (scroll using arrows) was:
cd /c
Just delete it (press twice on d), and then quit with saving, by pressing :, and then wqEnter.
That's it! The next time you open Git Bash Here - you should see the shell active on the relevant folder.

Is there a way to open command prompt in current folder?

I have a project folder somewhere, and many times I need to open command prompt (on windows 7/8.1/10) and cd to that folder. It would be very handy if there's an option right click > open cmd here.
is there a tool for that?
Just go to your folder location and type "cmd" on the address bar.
Press Shift + Menu, then choose Open Command Window Here. It works.
In win7/8, try right click while holding shift key, should have cmd prompt here
How about to use the PowerShell OpenHere module?
Run PowerShell with elevated permissions and type:
Install-Module OpenHere; Import-Module OpenHere
Set-OpenHereShortcut -ShortcutType:WindowsPowerShell
Disclaimer:
I'm a developer of this module.
use the description in https://stackoverflow.com/a/34534874/1498669 and put "run as administrator" checkbox on
Open 'File Explorer' and enter "shell:sendto" in location bar + hit return to get into this folder
Right mouse click and create a "New"->"Shortcut", put cmd.exe into the path, done
Edit the properties of the shortcut and edit the target to "%windir%\system32\cmd.exe /k pushd"
you can also create a copy of that shortcut, rename it to cmd.exe_admin, select properties, hit button "Advanced" an select the checkbox "run as Administrator"
Now use the "SendTo"-submenu in the explorer right click context menu to send any filepath or folder into the normal or elevated commandbox.
This "shell:sendto"-trick is also very useful for eg. Notepad++ or any program you want to start in "elevated" mode.
Type cmd command in address bar where path or location of the file or folder is shown.

Resources