LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Ultimate Prompt and bashrc. File (https://www.linuxquestions.org/questions/linux-general-1/ultimate-prompt-and-bashrc-file-4175518169/)

Mr. Alex 09-19-2014 01:35 AM

My humble :twocents: .

After some time of using Linux I lost interest in complicated bloated prompts. They distract a lot and you rarely really read data those prompts provide before any new command. I find simple
Code:

user@machine: $

user@machine: #

to be much better as it's neat, clean and doesn't have much to distract you (and eat up space).

Also, prompt with only current dir and type of user is nice.
Code:

~/downloads $

~/downloads #


maples 09-19-2014 08:42 AM

I agree- I couldn't work with that much info on my prompt...I would get completely lost...

I really like Debian's defauld bash prompt. Hostname, username, working directory. I really need to look at it to make my Arch laptop look the same way, so that it displays the full path to the current directory...

Habitual 09-19-2014 08:45 AM

I like my yellow-on-blue retro prompt:

maples 09-19-2014 08:48 AM

Quote:

Originally Posted by Habitual (Post 5240800)
I like my yellow-on-blue retro prompt:

C:/home????? What, did you boot from a DOS floppy, and have / formatted as fat32?

Habitual 09-19-2014 08:50 AM

Quote:

Originally Posted by maples (Post 5240802)
C:/home????? What, did you boot from a DOS floppy, and have / formatted as fat32?

All Linux all the time...
Code:

DOS='C:${PWD//\//\\\}>'
PS1="\[\033[00m\]\[\033[00m\]\[\033[01;39m\]$DOS\[\033[00m\]"

I remember floppy drives. :)

brianL 09-19-2014 08:51 AM

Here's a site where you can experiment with your prompt:
http://bashrcgenerator.com/

Habitual 09-19-2014 08:57 AM

Quote:

Originally Posted by brianL (Post 5240805)
Here's a site where you can experiment with your prompt:
http://bashrcgenerator.com/

+1 and Good Stuff. Thanks!

jeffguy77 09-22-2014 07:57 PM

Grail, awesome post. I took a look and will probably make some changes when I get time. I'm not the ultimate at shell scripting. I have collected a lot of this stuff over the years.

Habitual, that is an awesome blog! And I'm adding your up and down arrow search to my .bashrc because it's awesome. And I laughed at the C: on your prompt.

BrianL, nice link. I used to have a page like that where you could created different date formats and can't find it anymore.

Habitual 09-23-2014 10:46 AM

Quote:

Originally Posted by jeffguy77 (Post 5242706)
And I'm adding your up and down arrow search to my .bashrc because it's awesome. And I laughed at the C: on your prompt.

Yeah, I'm having mixed reactions to the solution offered in your post. If I use that it does fix the non-interactive issue with
"warning: line editing not enabled" messages, but I am then unable to use that 'feature' interactively.

So I am just kind of in the middle on it being "the solution" for me, atm.
But that's what I LOVE about Linux, there's always a 'way', we just have to be creative. :)
Have a Great Day.

suicidaleggroll 09-23-2014 11:42 AM

Quote:

Originally Posted by Habitual (Post 5242949)
Yeah, I'm having mixed reactions to the solution offered in your post. If I use that it does fix the non-interactive issue with
"warning: line editing not enabled" messages, but I am then unable to use that 'feature' interactively.

You did put the
Code:

iatest=$(expr index "$-" i)
line at the top right? Without that those if statements would just shut off the bind commands entirely. The command above is what makes it all work (by searching for "i" in "$-", which means it's an interactive session).

Habitual 09-23-2014 11:52 AM

Quote:

Originally Posted by suicidaleggroll (Post 5242976)
You did put the
Code:

iatest=$(expr index "$-" i)

doh!

NOW it's fixed. ;)

Thanks.

dugan 09-23-2014 11:59 AM

Why not put this on GitHub, jeffguy77?

jeffguy77 09-23-2014 04:42 PM

Quote:

Originally Posted by dugan (Post 5242981)
Why not put this on GitHub, jeffguy77?

Hmmm... interesting thought. I will say, most of the people who make complex prompts use zsh, not bash, because of it's right aligned prompt section and other extras. I prefer to stay on bash for compatibility. It's an idea though. Thanks for the suggestion!

Habitual, I'm glad it's working for you. And your blog has some interesting stuff. I didn't know you could put random times into a cron job.

genehunter 08-21-2015 01:42 PM

This does not work with the ultimate bashrc script
I am trying to use autojump, but it will not autoload the directories to the autojump list as the custom prompt is not compatible.
Here is the thread on the issue from other users.
askubuntu.com/questions/185962/autojump-in-12-04-doesnt-work

I tried using the change and adding to my .bashrc, but it does not work.
Any ideas on what to add to the ultimate .bashrc to make autojump work?

Pyrepenol 06-13-2016 11:06 AM

Just want to add that I absolutely love this script! Thanks for sharing!


All times are GMT -5. The time now is 10:15 AM.