alexpfx
alexpfx

Reputation: 6700

Git in terminal console - Android Studio - Autocomplete

Is there any way to make the built in terminal console of Android Studio (3.0 Canary) autocomplete git commands like the new Intellij Idea 2017 does?

-- EDITED

I have installed a clean copy of Intellij Idea 2017.1.4 on Windows 10 and noticed that this functionality is not provided by IntelliJ actually. I'm trying to identify that plugin.

-- EDITED

The solution is just set an external bash terminal and restart Android Studio like @lidkxx pointed out...

Upvotes: 3

Views: 4103

Answers (5)

Шахзод
Шахзод

Reputation: 311

Go to: File - Settings - Tools - Terminal

And change Shell path to: C:\Program Files\PowerShell\7\pwsh.exe

It helped to me.

Upvotes: 0

Behzad Rahimi
Behzad Rahimi

Reputation: 31

If you love bash & Linux command but forced to use Windows for development, you will love this trick. The console is colored like on Linux and autocomplete works way better than cmd/ PowerShell.

Requirement: Git installed with git-bash

Open Android Studio, go to File > Settings, open Tools > Terminal

Set “Shell Path” to C:\Program Files\Git\bin\bash.exe

Upvotes: 3

Milad Faridnia
Milad Faridnia

Reputation: 9477

Maybe its late.

To achieve this in windows you can use Powershell along with posh-git. Here are the steps:

1- In Android Studio -> Settings -> Tools -> Terminal -> set the Shell path to powershell.exe

enter image description here

2- Install posh-git:

1- Verify you have PowerShell 2.0 or better with $PSVersionTable.PSVersion

2- Verify execution of scripts is allowed with Get-ExecutionPolicy (should be RemoteSigned or Unrestricted). If scripts are not enabled, run PowerShell as Administrator and call Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -Confirm.

3- Verify that git can be run from PowerShell. If the command is not found, you will need to add a git alias or add %ProgramFiles%\Git\cmd to your PATH environment variable.

4- Clone the posh-git repository to your local machine.

5- From the posh-git repository directory, run .\install.ps1.

Enjoy ;)

Upvotes: 1

lidkxx
lidkxx

Reputation: 2841

Not sure if there's anything out of the box, but maybe try Preferences... -> search for Terminal. There's a shell path field and you can choose your shell to be anything you like. I am using zsh with autosuggestions plugin and autocomplete works like a charm.

Edit: You probably need to restart Android Studio for this change to take effect.

Upvotes: 13

Dmitrii Smirnov
Dmitrii Smirnov

Reputation: 7548

For me, 2017.2 on Mac does not autocomplete anything. Probably you are using different shell there, so you just need to configure Android Studio to use it as well, in Settings - Tools - Terminal.

Upvotes: 1

Related Questions