How can I use iterm as default terminal on macOS? - macos

I want to make iTerm2 as my default terminal on macOS,
I open iTerm2 and hit to make iTerm default Term
But it's not working!
And I go to default terminal preferences
But after open it I see this

(Open iTerm Build version 3.3.7)
Menu: iTerm2 > Make iTerm2 Default Term

It sounds like you need to rebuild your macOS' LaunchServices.
To do this, download OnyX and choose the version based on your current macOS version.
The option that you need is in the red box, and I'd suggest that you UNCHECK anything that you don't need or don't know; otherwise, you might end up with deleting data that you might need:
After that, you can try again with the built-in Make iTerm2 Default Term option in iTerm2 (if this option is greyed out for you, click option + the iTerm menu button to re-enable it again).
There are ways to do this through the command line without downloading third-party apps, but I trust OnyX enough to hand it the job.
However, if you decide to do it from the command line, make sure you type the command that corresponds to your current macOS version. More on that here.
Hope this helps :)

Use this location instead:
/Applications/iTerm.app/Contents/MacOS/iTerm2
but note that it will not solve your issue completely. Termianal will start anyway, but this time, it will run iTerm2 - as you instructed it to do.

One thing you can do is find the file that opens a terminal (in my case it was metro opening in a React Native app). Find the file in your finder, right click on it, choose get info, then expand the Open With tab. There you should find a dropdown menu on what to open those kind of files with. The default is terminal, but choose iTerm2 and click on change all.
For example, in my situation I had to find launchPackager.command file under node_modules/react-native/scripts/. Do the above with that file and it will make iTerm your default terminal after clicking change all.

From where do you want to open the terminal? I was facing the same problem as you when I wanted to open the external terminal from Visual Studio Code.
I solved it by going to Code > Preferences > Settings. Look for terminal in the search bar and setting /Applications/iTerm.app in Terminal > External for your operating system.

Related

How do you add the cmd+backspace functionality on VSCode's Integrated Terminal to the Mac's

I've been dying to get this working on the default terminal on the mac, this feature is really useful when you write something wrong, and can just cmd + backspace to delete all the lines.
I googled online several times but I couldn't find anything related to this.
Well, the functionality is already there: ⌃+U will delete everything left to your cursor to the beginning of the line. You cannot, however, change this keyboard shortcut.
You can change application-specific keybindings by installing additional tools like, for example, Karabiner.
Alternatively, you can install iTerm2 as a Terminal replacement. That will allow you to enable this - and many other text editing keybindings - with one click in the settings.

Integrated terminal in visual studio code is opening externally and not internally

I have reinstalled Visual Studio Code and for some reason, when I do the Ctrl+Shift+` shortcut, instead of opening a terminal window inside VS Code, it's opening an external command window, which is very annoying.
Anyone knows what setting it is to get it back internally?
I tried File->Preferences->Settings->Terminal and then set the first option "Customizes what kind of terminal to launch." to integrated.
Is there any other setting I need to set?
Happened the same with me. It was because I was using Legacy Console. To disable that, open any of your terminal (cmd or powershell) and right click to go to properties.
Properties -> Options -> Use Legacy console (tick it off).
Turn off ConPTY integration in the
File->Preferences->Settings->conPTY->Uncheck it
This is worked for me as mentioned here: https://stackoverflow.com/a/56267064/2462531
Found this:
https://github.com/microsoft/vscode/issues/72033
Which is listed as a duplicate but someone was also kind enough to link to this:
How do I get around the verified bug in Windows 1903 and launch the VSCode integrated terminal?
Which has a workaround as an answer, yay!
Here's some things you can check:
Make sure you've set integrated on both the User and the Workspace settings, because the Workspace settings can override the User settings.
Make sure you are using the correct keyboard shortcut. VS Code actually has a shortcut for opening the system's native console, which will open an external window:
Make sure that your Ctrl+Shift+` is actually the shortcut for Create New Integrated Terminal:

MacOS Bash in IntelliJ: stop copying things on selection

The bash shell in IntelliJ in MacOS is currently very misconfigured for me and this appears to be a default configuration. When I click into it and select a text it is automatically copied. That means every time I switch between windows and click into the shell in IntelliJ, I have to very cautious that the click really is just a click and I don't drag the mouse by accident because then everything from my clipboard is lost and I have copied some random letters. My current workaround is to not use the intellij terminal at all but to open iTerm from the iterm-button-plugin. But surely there must be a better solution?
You can just untick this checkbox

Visual Studio Code shortcut to display autocomplete list before typing on macOS

I am trying to display all possible words after putting the cursor in certain place in the code.
The autocomplete list appears when I start writing/typing:
However, I would like to see all suggested words even before typing.
I tried command + space, however it was a system shortcut for Search in macOS:
Any thoughts?
In case you are a CJK user using Mac, Ctrl+Space will not work, since it is used to switch IMEs.
There is another keyboard shortcut for triggering suggestions:
Option+Esc (Mac)
Alt+Esc (Windows)
Also see this post.
VS code version: 1.41.1
I solved this problem using fn+control+space.
Hope it helps you.
"change input source" keyboard shortcut should be disabled
To disable it->
Go to system preferences -> keyboard -> input sources
add a new input source (choose ABC)
Go to shortcuts tab (inside of keyboard settings)
Click on input sources on the left
disable the "select previous input source" shortcut
restart your vs code and now ctrl+space will show quick suggestions.
You can use the following alternative keyboard shortcuts:
⌘+I (mentioned in the official VS Code documentation for "Trigger suggestion")
⌥+esc
fn+control+space
The shortcut for the "Trigger Suggest" command is ⌃Space (ctrl+space) — as mentioned in the comments.
Most default shortcuts can be found in the documentation, which will automatically show the correct keybindings for the system you're on. In other words, if you visit the page on a Mac, you'll see Mac keybindings.
Additionally, you can:
go to Code > Preferences > Keyboard Shortcuts (on a Mac) and search for keybindings based on the command you want to execute
open up "show all commands" (⇧⌘P on a Mac) and search for the command there, allowing you to either view the keybinding for that command, or simply navigate to it directly from the search
Of course you'd have to have some idea of what the command's name might be. And in this case, a search for "suggest" would suffice.
If you use too many keyboard layouts, maybe the MacOS shortcut might be active. You can disabled ^(Ctrl)+Space shortcuts for MacOS.
System Preferences>Keyboard>Shorcuts>Input Sources> Disable Select the previous input source.
You can use next shortcut for change input sources.Ctrl+Alt+Space
when I was set up 2 keyboards with different layouts, and it turn out it overrides the ^+Space behavior, so this is how fix it:
Go to system preferences -> Keyboard -> Keyboard shortcuts
Click on input sources
and disable the "select previous input source" shortcut

is it possibile to open iTerm in current Finder position

Sometimes it could be very useful to open new iTerm window. I've seen this feature in Gnome window manager. It is possible to get same feature on MaxOsX? Is there a software to do that?
Go to System Preferences -> Keyboard -> Shortcuts -> Services -> Files and Folders and give preferred shortcuts.
The shortcut will open iTerm at the selected folder, instead of from the folder that has been opened.
You can right-click on the folder where you want iTerm2 to open, then select Services -> New iTerm2 Tab here.
You can also find other options in the Services menu to open iTerm2 and Terminal.
This was tested on iTerm2 3.x and Catalina and above.
There are two apps called "Go2Shell" and "ShellHere". Both place a small icon at the top of the finder window. When the icon is clicked a terminal window opens in the same directory as the finder window.
Go2Shell
Go2Shell can be downloaded from Mac App Store or developer's website. It is possible that you won't be able to install it from Mac App Store, because Go2Shell wasn't updated for a long time.
Go2Shell allows users to specify whether to open shell in Terminal or iTerm2.
ShellHere
Shellhere can be downloaded from here.
ShellHere allows users to open a folder only in uses only MacOS Terminal.
Problem with current solutions: Doesn't work in current folder. Only if you right click a folder.
So do this:
In Finder, press ⌥ + ⌘ + P to show the path bar.
Then, right click your folder and choose the option. Voila!
Try https://github.com/wonderyue/Go2ShellAppleScript.
Something like Go2Shell. The latest update of Go2Shell is five years ago, due to the compatibility problem, I make a similar one with AppleScript.
If you want to open iTerm in current Finder position try the following:
OpenInTerminal
https://github.com/Ji4n1ng/OpenInTerminal
Alternative and a bit older
TermHere
https://hashbang.productions/apps/termhere/ (last updated on 2016)
Both work without issues in MacOS Catalina
cdto doesn't support opening the folder in iTerm, so its a no go
If you have BetterTouchTool, you can just create a Finder trigger with action "Open Active/Selected Folder With Specific App" and select "iTerm". Works for me!
BetterTouchTool screenshot
EDIT:
You can even add Hotkey Window hotkey before "Open Active/Selected Folder With Specific App" to open the terminal in the hotkey window (as a tab). Really neat.
In hotkey window
I've been using cdto forever before accidentally stumbling on to the accepted answer. Will definitely try out the accepted answer, but leaving a link to cdto here if someone finds in useful
https://github.com/jbtule/cdto

Resources