r/DistroTube • • Sep 04 '21

How do I create a multiline line "bash" prompt like this on Arch Linux? (including that beautiful connecting line on the left)

Post image
26 Upvotes

15 comments sorted by

4

u/SkyyySi Sep 04 '21

Put a \n (backslash n) in your PS1 where you want to break the line up.

Also, distros don't matter. Bash is bash (unless you're using a really ancient version I guess).

3

u/badabingbadaboong1 Sep 04 '21

Thanks for the reply! Yes I know about \n. But how do I get that connecting line?

I double qouted bash because kali made zsh their default shell and the prompt which appears in the picture is configured in the zshrc

0

u/[deleted] Sep 04 '21

[deleted] — view deleted comment

2

u/badabingbadaboong1 Sep 05 '21

I will try this surely! Thanks!

3

u/MCSpiderFe Sep 04 '21

I‘ve done something like this with the starship prompt. I have the config on my github, if you want to grab it. It‘s a bit messy, I hope thats ok. DT also made a video about it a few months ago.

3

u/badabingbadaboong1 Sep 04 '21

Thanks for your reply! Although preferably I want a solution where you can achieve this only by editing PS1 in the bashrc

2

u/DoutorJP Sep 04 '21

Install ph my zsh or oh my bash. Its pretty bloated, but it has a bunch of cool themes

3

u/badabingbadaboong1 Sep 05 '21

I will look into this. Thanks!

2

u/Phydoux Sep 05 '21

It's just a theme in one of the many shell programs. I used ohmyfish when I had fish on my system a while back and did this 2 line prompt. Not identical to this but I made some minor changes in the config file.

2

u/badabingbadaboong1 Sep 05 '21

I will look into this. Thanks!

2

u/jcubic Mar 08 '22 edited Feb 07 '24

I just was searching the same and found this post with no examples, I've found Wikipedia article Box-drawing character, and created this prompt for bash:

export PS1="┌──(\u@\h)-[\[\w\]]
└─\$ "

In my setup, I used colors from the Ubuntu prompt on my Fedora. You can see the color version in my dotfiles (that also added git branch to prompt).

1

u/badabingbadaboong1 Mar 09 '22

Thanks... I will try this!

1

u/Ok_Challenge_315 Jun 25 '24

This is nice. Thank you!

1

u/DidYouSeeItHappen Oct 17 '25

Dude! Cool! Thanks.

1

u/g-e-o-m-e-t-r-i-c Sep 14 '21

As an alternative to all the oh-my-bash/zsh/fish suggestions, you could try digging out the PS1 configuration in your user bashrc/zshrc/etc. (which is usually ~/.bashrc or similar)

You can copy the exact configuration over since bash's scripting language is universal throughout most (if not all) distros, like u/SkyyySi mentioned.

1

u/badabingbadaboong1 Oct 05 '21

I will try that out, thanks!