VSCode - Open new terminal window in vsc - terminal

Is there any way to open a new terminal window within vscode and run code in it?

Click on "+" button marked with red color

You can also go to the View menu and select Terminal. It will open a terminal window under your editor window.

Or you can use the command " Ctrl + ` " and it will open a new terminal.

Related

how to shift code up or down with the up and down arrow keys on vs code mac?

On linux, i press alt + up or down to shift code up or down on vs code.
how do i do the same on mac?
it's a command Move Line Up/Down.
open show all command with shift+cmd+p
type Preferences: Open keyboard shortcuts
search move line
look what keybinding you have (mine was option + up/down)

How can I have different bash setting for opening tabs and windows using ITerm

When I use terminal, I can set up something in .bashrc or .zshrc to initiate my terminal.
But if I wanna my terminal iTerm have different settings for opening new tabs and new windows, for example, when I open a new tab, terminal will print Hello, instead when I open a new window, it will print World.
How should I edit my rc file or edit the setting of my terminal emulator such as iTerm or something else?

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.

How to open the iTerm in the sublime text 3?

I installed the Terminal package in the sublime3, setting in the package:
{
"terminal": "iTerm.sh",
"parameters": []
}
But when I press the command + shift + T buttons together,there is no response,Why?
For iTerm2 on Sublime Text 3 with Bond's terminal package do the following:
In Sublime 3, go to Preferences > Package Settings > Terminal > Settings - User
Paste the following & save:
{
"terminal": "iTerm2-v3.sh",
"parameters": ["--open-in-tab"]
}
Test opening project folder on iTerm2 with cmd + shift + T (Working on Sublime 3 build 3131)
Terminal package site reference:
Download this shell script and add it to your system path with the name iTerm2-v3.sh.
Make sure you have iTerm >= 3.0.4 or even better, latest iTerm2-v3.
Go to Preferences > Package Settings > Terminal > Settings - User. Your settings file should look like this.
{
"terminal": "iTerm2-v3.sh",
"parameters": ["--open-in-tab"]
}
Also, double check your shortcut is not overridden by other command. Hit Cmd+Shift+P and type Terminal: Open
This should work. The iTerm might not get activated, you have to switch to iTerm2 and check if the current folder in Sublime has opened in a new tab in iTerm2.
Hard to say without more information. However, a good way to debug such issues is to look in the console. To open the sublime console, press Ctrl + ` or select View → Show Console from the main menu. Now press the shortcut again and see if some debug message is shown.
If you suspect that something is wrong with the keybinds, you can run view.run_command('open_terminal') from the console. This is the command that is issued on cmd+shift+t (see the config file of the package).
As a side-note. I didn't know this package existed, instead I once wrote a few lines to do exactly this. It can be useful if you want to play around with running a terminal or such yourself.
import sublime_plugin, subprocess
class OpenTerminal(sublime_plugin.TextCommand):
def run (self, edit):
if self.view.file_name():
cwd = '/'.join(self.view.file_name().split('/')[:-1])
else:
cwd = self.view.window().project_data()['folders'][0]['path']
subprocess.Popen(['xfce4-terminal', '--working-directory=' + cwd])

How to paste into SourceTree terminal window when using vagrant ssh

In Sourcetree when you click Terminal and use the vagrant ssh command in the window, how to paste text from your clipboard?
These don't work:
Ctrl + V
Ctrl+Shift+Ins
Right clicking in the window and selecting Paste.
To paste into it when using Windows, you have to:
Right click on the top bar
Select Edit
Select Paste

Resources