You are not logged in.

#1 2014-07-31 13:00:10

shoober420
Banned
Registered: 2014-07-22
Posts: 184

[Solved] How To Add Blank Space In Prompt With zsh

How can I get zsh to show the full directory path I'm in, instead of just my hostname?

Last edited by shoober420 (2014-07-31 16:53:51)

Offline

#2 2014-07-31 13:07:04

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [Solved] How To Add Blank Space In Prompt With zsh

Offline

#3 2014-07-31 14:15:24

fsckd
Forum Fellow
Registered: 2009-06-15
Posts: 4,173

Re: [Solved] How To Add Blank Space In Prompt With zsh

Moving from Applications & Desktop Environments to Newbie Corner.


aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies

Offline

#4 2014-07-31 15:40:18

shoober420
Banned
Registered: 2014-07-22
Posts: 184

Re: [Solved] How To Add Blank Space In Prompt With zsh

Okay, I got the path showing. Now, how do I add a space in the prompt, so that the path is seperated from whats being typed?

Offline

#5 2014-07-31 16:04:53

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [Solved] How To Add Blank Space In Prompt With zsh

You should be able to just add a space in your prompt. Can you post the prompt you have now?
Have a look at https://wiki.archlinux.org/index.php/Color_Bash_Prompt

PS1='[\u@\h \W]\$ '

The prompt goes between the ' ' - the last two characters are $ and a space. Try doing something similar.

Offline

#6 2014-07-31 16:06:36

shoober420
Banned
Registered: 2014-07-22
Posts: 184

Re: [Solved] How To Add Blank Space In Prompt With zsh

Here is my prompt.

PROMPT=%~%#_

I'm using an underscore for now, just to seperate the path from the commands being typed so they're not next to each other.

Offline

#7 2014-07-31 16:09:50

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [Solved] How To Add Blank Space In Prompt With zsh

Try

PROMPT="%~%# "

Offline

#8 2014-07-31 16:21:24

shoober420
Banned
Registered: 2014-07-22
Posts: 184

Re: [Solved] How To Add Blank Space In Prompt With zsh

Nice! Thank you so much karol. I have settled with the following prompt.

PROMPT="[%~]%# "

Last edited by shoober420 (2014-07-31 16:42:59)

Offline

Board footer

Powered by FluxBB