Inspiration

I wanted to customize my command prompt, but got frustrated testing different ones. Iff you botch the prompt enough, the terminal can become pretty much unusable, and the process of opening and closing sessions was kinda frustrating. I wanted a sandbox environment to test different ones, so I built this.

What it does

It interprets the value of the Bash PS 1-4 and returns what would be printed on a terminal.

How I built it

Pseudocode to VS Code to deploy?

Challenges I ran into

The most challenging bit was getting myself not to think about JavaScript in terms of another language; I kept expecting both data types and objects to behave as they do in Java, which was really not the case. Keeping track of which data type I was working with and figuring out when it mattered and when it didn't was pretty rough. Controlling the flow was pretty rough, since I didn't realize the scope of functions worked the way I thought it would.

Accomplishments that I'm proud of

Designing and building an app that was pretty close to what I was looking for!

What I learned

I learned about how JavaScript deals with data types and objects, and how to manipulate that to style and format strings. I also learned about JavaScript data structures like arrays and maps, which I've never done before :)

What's next for Bash Prompt Interpreter

Working with environmental variables and letting the user add in any ones they like, and adding in the full ANSI color scheme (not just the most common ones) and other styles like blinking would be nice! Having an alert when syntax is technically correct but might not produce anticipated results could also be useful. Finding a way to make the code a bit less repetitive would also be pretty nice.

Share this project:

Updates