You are not logged in.

#1 2022-04-21 16:33:08

doomguy84
Member
Registered: 2018-05-09
Posts: 49

[SOLVED] BASH - always view the entire current path (full path)

Hi
I have a custom colored bash that when I open it shows like this:

user@machine:~]$

then when I go to the Download folder it shows like this:

user@machine:Download]$

and then again when I go to a Download subdir it shows like this:

user@machine:subdir]$

is there a way to always view the entire path?
I mean:

user@machine:/home/user]$ cd Download
user@machine:/home/user/Download]$ cd subdir
user@machine:/home/user/Download/subdir]$ 

Thanks in advance


EDIT: Solution

I added this new line on my .bashrc, just before the line of "export PS1=..."

export GIT_PS1_PROMPT_DIRTRIM=4

the "4" is the number of directory levels to show

and modified the "\W" with "\w"

Last edited by doomguy84 (2022-04-22 08:33:45)

Offline

#2 2022-04-21 18:04:10

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [SOLVED] BASH - always view the entire current path (full path)


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#3 2022-04-22 08:11:46

doomguy84
Member
Registered: 2018-05-09
Posts: 49

Re: [SOLVED] BASH - always view the entire current path (full path)

thanks but...
I read it all, and the only thing I found was a "PROMPT_DIRTRIM" option to put into .bashrc, but it doesn't work
I believe it's my fault, but I can't figure out what is the problem

Offline

#4 2022-04-22 08:21:29

Awebb
Member
Registered: 2010-05-06
Posts: 6,688

Re: [SOLVED] BASH - always view the entire current path (full path)

Try https://bashrcgenerator.com/. There are many PS1 generators, I find them very helpful as a learning tool, because the syntax isn't trivial.

Offline

#5 2022-04-22 08:29:38

doomguy84
Member
Registered: 2018-05-09
Posts: 49

Re: [SOLVED] BASH - always view the entire current path (full path)

I found my fault!!
I was using \W instead of \w

now it show the full path!!
thanks!

also thanks to Awebb, i will look that nice

Offline

Board footer

Powered by FluxBB