Trailing slash - where & how to configure

I asked this many time ago but i forgot the answer:

In which file - ~/.zshrc ? - and how do i set the environment in a way that a directory in the shell is presented with a trailing slash (like it is defaultwise in slackware)? To be clear, like this:

~/.config/kitty/

for example.

Thanks a lot in advance.

Look for the prompt

echo $PS1

Usually set in .zshrc but when using manjaro-zsh-config - it located in /usr/share/zsh/manjaro-zsh-prompt

What should “echo PS1” give? To me it gives:

echo PS1

[EDIT]
I found out: It should be

echo $PS1

When doing so, i get:

%B%{%}%(4~|%-1~/.../%2~|%~)%u%b >%{%}>%B%(?.%{%}.%{%})>%{%}%b

Now, where and how to set the trailing slash here?
[/EDIT]

typo - fixed

echo $PS1

On my system I have several PS variables (using tab completion)

➜  ~ echo $PS
PS1    PS2    PS3    PS4    psvar  PSVAR

I found out: I have in my .zshrc this alias set:

alias ls='ls -F'

That is not what you asked in OP - you didn’t specify the output from ls as being the target.

Copy /usr/share/zsh/manjaro-zsh-prompt

Edit the prompt - experiment on insert an extra slash (/) somewhere after %2

%B%{%}%(4~|%-1~/.../%2~|%~)%u%b >%{%}>%B%(?.%{%}.%{%})>%{%}%b

You’re right, obviously :slight_smile: But anyhow, this alias seems to provide me systemwide the trailing slash (to distinguish well in a shell a file from a directory).

I’ll try what you suggest an report back. Thanks a lot for your patience!

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.