Mike Lynch
cøder • juggler • maker of things
  • Home
  • About
  • Projects
  • Resources
ijwithterminal
January 25 2017

Custom Bash Prompt in Intellij

Michael Lynch Software Development bash, intellij 0

Recently I wanted to change the prompt in the terminal when using IntelliJ.  I have a development prompt that I like to use whenever I am developing and wanted IntelliJ to also use it.

If you just point the terminal in IntelliJ to a script that sets your prompt, it will not work.  It simply runs that script and fails to open the terminal.  There are a few solutions to the problem if you are using bash (thanks thrig!).

  1. Method 1: Running bash --rcfile mycustomrc will read whatever customizations you need from the given file.  It may also be helpful to use the --login or --noprofile flags depending on whether you do or do not want the mycustomrc to mix with the standard shell settings.
  2. Method 2: Use an environmental flag to determine whether or not to load the custom settings in the standard shell settings files.
  3. Method 3: Feed the custom shell configuration into a new bash process, then interact with it. See e.g. feed, feed.1, zcomppoke, zcomppoke.1 for this pattern in action.

I choose method #1 since it was the simplest for what I wanted, and did not require me to add an environment variable before it would work.

To make this work, I had to set the terminal prompt as follows:


/bin/bash --rcfile ~/.dotfiles/dev_bashrc

That was all there is to it, the dev_bashrc is in my dotfiles repo on github.  It simply changes the prompt and loads as normal.

  • Twitter
  • Facebook
  • LinkedIn
  • Google
  • More
  • Reddit
  • Tumblr
  • Pocket
  • Pinterest
Python Libraries for Computational Statistics, Data Science & Machine Learning Angular 2 CLI Updated to 1.0

Related Posts

hexGameRandomness

Game Development, Software Development

Hex Game – Procedural Board Generation

angular2cli

Software Development

Angular 2 CLI Updated to 1.0

LeagueEuchre

AI, Game Development, Software Development

Minimax In Action!

Search

Recent Tweets

My Tweets

Subscribe via Email

Enter your email address to subscribe and receive notifications of new posts by email.

Top Posts & Pages

  • Using Wand to extract images from PDFs in python
    Using Wand to extract images from PDFs in python
  • Adding swagger to your DropWizard application
    Adding swagger to your DropWizard application
  • How to run a Dropwizard Application in Intellij Idea
    How to run a Dropwizard Application in Intellij Idea
  • Installing Oracle Instant Client and SQL*Plus on OSX
    Installing Oracle Instant Client and SQL*Plus on OSX

Categories

  • AI
  • Education and Technology
  • Fun-N-Games
  • Game Development
  • Software Development
  • Uncategorized
Mike Lynch
© Michael Lynch 2008-2018
Photo by A.D. Wheeler Creative Commons
Thanks for visiting!
Privacy & Cookies: This site uses cookies.
To find out more, as well as how to remove or block these, see here: Our Cookie Policy