I don't know this is a bug or I understand it wrong
I wanna do something like this:

So I have this in .zshrc
ZSH_THEME="spaceship"
SPACESHIP_DIR_SHOW="true"
SPACESHIP_DIR_PREFIX="at "
But I dont see its affect

So, I don't know I get it wrong (I read a little in source code) or why It can't run?
Operating system: Linux
Terminal emulator: terminator
ZSH version: zsh 5.4.1
I only see SPACESHIP_DIR_PREFIX if I have something before the directory. In my normal usage, my prompt does not display a user, so I don't see the dir prefix. If I ssh into localhost, then my hostname and username get printed, so I also see the dir prefix:
~
➜ ssh 127.0.0.1
user at mymachine in ~
➜ SPACESHIP_DIR_PREFIX="hi there "
user at mymachine hi there ~
➜
The maintainers can comment on if this is intended behavior or not, this is just what I observe.
It was intentional to hide _PREFIX before the first section. Here is the relevant section of source code
It was intentional to hide _PREFIX before the first section. Here is the relevant section of source code
Thank you. So the workaround if I wanna force display prefix is having this in .zshrc
SPACESHIP_OPENED=true
Seem abuse the code when the source code write:
SPACESHIP_OPENED=false # Internal variable for checking if prompt is opened
But it meet my need.
SPACESHIP_OPENED=true would do the trick.
But, You should also expect _PREFIX for time,user and host sections, which appear before dir section. Or, you could define custom prompt order.
@BeyondTheBoundary I have to aware you that SPACESHIP_OPENED is an internal variable, so we can remove this without any deprecation warning.
Probably it will be exposed with the next major version (please, open a request-feature issue, if you want that). However, I'm going to almost completely rewrite sections rendering in the next major release.
Most helpful comment
It was intentional to hide
_PREFIXbefore the first section. Here is the relevant section of source codehttps://github.com/denysdovhan/spaceship-zsh-theme/blob/522987a502ac3283c29efc6f01e20e55c5c042ec/spaceship.zsh#L325-L327