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 clickon the terminal window and selectPreferences) -
Look for
shelland configure the following:shell: 'C:\\Program Files\\Git\\bin\\sh.exe', -
Look for
shellArgsand configure the following:shellArgs: ['--login', '-i'],OPTIONAL - You can also install some Hyper plugins under the
pluginssection 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
.bashrcfile using a code editor and add: Here are some of mine:alias startagent="eval $(ssh-agent -s)" alias ll="ls -l -a"The
startagentalias starts a ssh-agent for you to add sshkey to. Thellalias I modified to show hidden files using the-aswitch
NOTE - There's no space between alias name equal sign (=) and command
- After you save and close the
.bashrcfile, use the commandsource ~/.bashrcenable your changes, you can also restart your Terminal. - Type
aliasagain 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 asstartagenton the terminal.
Thanks for reading!