Windows Terminal Setup with Git Bash and Hyper
Okay... I'm switching back...
A few days back I wrote an article talking about using the Windows Subsystem for Linux, zsh, oh-my-zsh and Hyper as my Windows terminal/development solution. However, after using it a few days, I find that it makes my life harder...
First of all, I have to install all my packages in Linux, such as NodeJS and Python (I know...Ubuntu comes with Python preinstalled, but I need to upgrade it to > 3.6 to get some new features working). Secondly, my Windows directory is located at /mnt/c/Users/lance
, this makes navigating between Linux and Windows tedious, and some of my projects references my local Windows directory, so I have to change all that...tedious...
You can see my previous setup of Hyper and zsh here
Install Git Bash
Download Git Bash
Install Hyper
Download https://hyper.is/
Configure Hyper to use Git Bash
- Launch
Hyper
- Open
Preferences
(ctrl + ,
orRight click
on the terminal window and selectPreferences
) -
Look for
shell
and configure the following:shell: 'C:\\Program Files\\Git\\bin\\sh.exe',
-
Look for
shellArgs
and configure the following:shellArgs: ['--login', '-i'],
OPTIONAL - You can also install some Hyper plugins under the
plugins
section inPreferences
, you can refer to my previous article about plugins.
That's it! Much simplier than using WSL
Bonus
Adding Alias
.
As some of you might know, aliases are like shortcuts to execute commands. Git Bash has included two shortcuts you can use, ll
and ls
. If you type alias
on the terminal, you will see a list of preconfigured shortcuts.
To add more, you need to configure the .bashrc
file. If your computer does not already have it, make one by using touch ~/.bashrc
-
Open the
.bashrc
file using a code editor and add: Here are some of mine:alias startagent="eval $(ssh-agent -s)" alias ll="ls -l -a"
The
startagent
alias starts a ssh-agent for you to add sshkey to. Thell
alias I modified to show hidden files using the-a
switch
NOTE - There's no space between alias name
equal sign (=)
and command
- After you save and close the
.bashrc
file, use the commandsource ~/.bashrc
enable your changes, you can also restart your Terminal. - Type
alias
again in the terminal, if everything is configured correctly, you will see your customized alias on the list. - To use your alias, simply type the
alias name
, such asstartagent
on the terminal.
Thanks for reading!